Class TarOutputStream
java.lang.Object
java.io.OutputStream
com.codename1.io.BufferedOutputStream
com.codename1.io.tar.TarOutputStream
- All Implemented Interfaces:
AutoCloseable
-
Field Summary
Fields inherited from class BufferedOutputStream
buf, count -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Appends the EOF record and closes the streamprotected voidCloses the current tar entryprotected voidpad()Pads the last content blockvoidputNextEntry(TarEntry entry) Writes the next tar entry header on the streamvoidwrite(byte[] b, int off, int len) Checks if the bytes being written exceed the current entry size.voidwrite(int b) Writes a byte to the stream and updates byte countersMethods inherited from class BufferedOutputStream
flush, flushBuffer, getConnection, getDefaultBufferSize, getLastActivityTime, getName, getTotalBytesWritten, setConnection, setDefaultBufferSize, setProgressListener, writeModifier and TypeMethodDescriptionvoidflush()Flushes this buffered output stream.voidFlush the internal bufferIf applicable this member represents the connection object for the streamstatic intThe default size for a stream bufferlongReturns the time of the last activitygetName()Indicates the name of the stream for debugging purposesintReturns the total amount of bytes written to this stream so farvoidsetConnection(Object connection) If applicable this member represents the connection object for the streamstatic voidsetDefaultBufferSize(int aDefaultBufferSize) The default size for a stream buffervoidsetProgressListener(IOProgressListener progressListener) Sets the callback for IO updates from a buffered streamvoidwrite(byte[] b) Writesb.lengthbytes to this output stream.Methods inherited from class Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitModifier and TypeMethodDescriptionprotected Objectclone()booleanIndicates whether some other object is "equal to" this one.final ClassgetClass()Returns the runtime class of an object.inthashCode()Returns a hash code value for the object.final voidnotify()Wakes up a single thread that is waiting on this object's monitor.final voidWakes up all threads that are waiting on this object's monitor.toString()Returns a string representation of the object.final voidwait()Causes current thread to wait until another thread invokes the method or the method for this object.final voidwait(long timeout) Causes current thread to wait until either another thread invokes the method or the method for this object, or a specified amount of time has elapsed.final voidwait(long timeout, int nanos) Causes current thread to wait until another thread invokes the method or the method for this object, or some other thread interrupts the current thread, or a certain amount of real time has elapsed.
-
Constructor Details
-
TarOutputStream
-
-
Method Details
-
close
Appends the EOF record and closes the stream
See also
- java.io.FilterOutputStream#close()
- Specified by:
closein interfaceAutoCloseable- Overrides:
closein classBufferedOutputStream- Throws:
IOException
-
write
Writes a byte to the stream and updates byte counters
See also
- java.io.FilterOutputStream#write(int)
- Overrides:
writein classBufferedOutputStream- Throws:
IOException
-
write
Checks if the bytes being written exceed the current entry size.
See also
- java.io.FilterOutputStream#write(byte[], int, int)
- Overrides:
writein classBufferedOutputStream- Throws:
IOException
-
putNextEntry
Writes the next tar entry header on the stream
Parameters
entry
Throws
IOException
- Throws:
IOException
-
closeCurrentEntry
Closes the current tar entry
Throws
IOException
- Throws:
IOException
-
pad
Pads the last content block
Throws
IOException
- Throws:
IOException
-