Class TarInputStream
java.lang.Object
java.io.InputStream
com.codename1.io.BufferedInputStream
com.codename1.io.tar.TarInputStream
- All Implemented Interfaces:
AutoCloseable
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidCloses the current tar entryReturns the next entry in the tar filebooleanvoidmark(int readlimit) Not supportedbooleanTests if this input stream supports themarkandresetmethods.intread()Read a byteintread(byte[] b, int off, int len) Checks if the bytes being read exceed the entry size and adjusts the byte array length.voidreset()Not supportedvoidsetDefaultSkip(boolean defaultSkip) longskip(long n) Skips 'n' bytes on the InputStreamprotected voidskipPad()Skips the pad at the end of each tar entry file contentMethods inherited from class BufferedInputStream
available, close, getConnection, getDefaultBufferSize, getInternal, getLastActivityTime, getName, getTotalBytesRead, getYield, isDisableBuffering, isPrintInput, read, setConnection, setDefaultBufferSize, setDisableBuffering, setPrintInput, setProgressListener, setYield, stopModifier and TypeMethodDescriptionintReturns an estimate of the number of bytes that can be read (or skipped over) from this input stream without blocking by the next invocation of a method for this input stream.voidclose()Closes this input stream and releases any system resources associated with the stream.If applicable this member represents the connection object for the streamstatic intThe default size for a stream bufferAllows access to the underlying input stream if desiredlongReturns the time of the last activitygetName()Indicates the name of the stream for debugging purposesintReturns the total number of bytes read from this stream so farintgetYield()Allows setting a yield duration for this stream which is useful for background operations to release CPUbooleanReturns
booleanPrints out all the data that passes through this stream to the console.intread(byte[] b) Reads some number of bytes from the input stream and stores them into the buffer array b.voidsetConnection(Object connection) If applicable this member represents the connection object for the streamstatic voidsetDefaultBufferSize(int aDefaultBufferSize) The default size for a stream buffervoidsetDisableBuffering(boolean disableBuffering) Parameters
voidsetPrintInput(boolean printInput) Prints out all the data that passes through this stream to the console.voidsetProgressListener(IOProgressListener progressListener) Sets the callback for IO updates from a buffered streamvoidsetYield(int yield) Allows setting a yield duration for this stream which is useful for background operations to release CPUvoidstop()Stop reading from the stream, invoking this will cause the read() to return -1Methods 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
-
TarInputStream
-
-
Method Details
-
markSupported
public boolean markSupported()Description copied from class:BufferedInputStreamTests if this input stream supports the
markandresetmethods. ThemarkSupportedmethod ofBufferedInputStreamreturnstrue.Returns
- Overrides:
markSupportedin classBufferedInputStream- Returns:
a
booleanindicating if this stream type supports themarkandresetmethods.See also
-
java.io.InputStream#mark(int)
-
java.io.InputStream#reset()
-
-
mark
-
reset
Not supported- Overrides:
resetin classBufferedInputStream- Throws:
IOException
-
read
Read a byte
See also
- java.io.FilterInputStream#read()
- Overrides:
readin classBufferedInputStream- Returns:
the next byte of data, or
-1if the end of the stream is reached.Throws
IOException: @throws IOException if this input stream has been closed by invoking its#close()method, or an I/O error occurs.
- Throws:
IOException
-
read
Checks if the bytes being read exceed the entry size and adjusts the byte array length. Updates the byte counters
See also
- java.io.FilterInputStream#read(byte[], int, int)
- Overrides:
readin classBufferedInputStream- Returns:
the number of bytes read, or
-1if the end of the stream has been reached.Throws
IOException: @throws IOException if this input stream has been closed by invoking its#close()method, or an I/O error occurs.
- Throws:
IOException
-
getNextEntry
Returns the next entry in the tar file
Returns
TarEntry
Throws
IOException
- Throws:
IOException
-
closeCurrentEntry
Closes the current tar entry
Throws
IOException
- Throws:
IOException
-
skipPad
Skips the pad at the end of each tar entry file content
Throws
IOException
- Throws:
IOException
-
skip
Skips 'n' bytes on the InputStream
Overrides default implementation of skip
- Overrides:
skipin classBufferedInputStream- Throws:
IOException
-
isDefaultSkip
public boolean isDefaultSkip() -
setDefaultSkip
public void setDefaultSkip(boolean defaultSkip)
-