public class ArArchiveOutputStream extends ArchiveOutputStream<ArArchiveEntry>
| Modifier and Type | Field and Description |
|---|---|
static int |
LONGFILE_BSD
BSD ar extensions are used to store long file names in the archive.
|
static int |
LONGFILE_ERROR
Fail if a long file name is required in the archive.
|
| Constructor and Description |
|---|
ArArchiveOutputStream(java.io.OutputStream out) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Calls finish if necessary, and then closes the OutputStream
|
void |
closeArchiveEntry()
Closes the archive entry, writing any trailer information that may be required.
|
ArArchiveEntry |
createArchiveEntry(java.io.File inputFile,
java.lang.String entryName)
Creates an archive entry using the inputFile and entryName provided.
|
ArArchiveEntry |
createArchiveEntry(java.nio.file.Path inputPath,
java.lang.String entryName,
java.nio.file.LinkOption... options)
Creates an archive entry using the inputPath and entryName provided.
|
void |
finish()
Finishes the addition of entries to this stream, without closing it.
|
void |
putArchiveEntry(ArArchiveEntry entry)
Writes the headers for an archive entry to the output stream.
|
void |
setLongFileMode(int longFileMode)
Sets the long file mode.
|
void |
write(byte[] b,
int off,
int len) |
canWriteEntryData, getBytesWritten, getCount, writepublic static final int LONGFILE_ERROR
public static final int LONGFILE_BSD
public void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class java.io.OutputStreamjava.io.IOExceptionpublic void closeArchiveEntry()
throws java.io.IOException
ArchiveOutputStreamcloseArchiveEntry in class ArchiveOutputStream<ArArchiveEntry>java.io.IOException - if an I/O error occurspublic ArArchiveEntry createArchiveEntry(java.io.File inputFile, java.lang.String entryName) throws java.io.IOException
ArchiveOutputStreamcreateArchiveEntry in class ArchiveOutputStream<ArArchiveEntry>inputFile - the file to create the entry fromentryName - name to use for the entryjava.io.IOException - if an I/O error occurspublic ArArchiveEntry createArchiveEntry(java.nio.file.Path inputPath, java.lang.String entryName, java.nio.file.LinkOption... options) throws java.io.IOException
The default implementation calls simply delegates as:
return createArchiveEntry(inputFile.toFile(), entryName);
Subclasses should override this method.
createArchiveEntry in class ArchiveOutputStream<ArArchiveEntry>inputPath - the file to create the entry fromentryName - name to use for the entryoptions - options indicating how symbolic links are handled.java.io.IOException - if an I/O error occurspublic void finish()
throws java.io.IOException
ArchiveOutputStreamfinish in class ArchiveOutputStream<ArArchiveEntry>java.io.IOException - if the user forgets to close the entry.public void putArchiveEntry(ArArchiveEntry entry) throws java.io.IOException
ArchiveOutputStreamArchiveOutputStream.closeArchiveEntry()
to complete the process.putArchiveEntry in class ArchiveOutputStream<ArArchiveEntry>entry - describes the entryjava.io.IOException - if an I/O error occurspublic void setLongFileMode(int longFileMode)
longFileMode - the mode to usepublic void write(byte[] b,
int off,
int len)
throws java.io.IOException
write in class java.io.OutputStreamjava.io.IOExceptionCopyright © 2010 - 2024 Adobe. All Rights Reserved