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, stop
-
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
public void reset() throws java.io.IOExceptionNot supported- Overrides:
resetin classBufferedInputStream- Throws:
java.io.IOException
-
read
public int read() throws java.io.IOExceptionRead 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:
java.io.IOException
-
read
public int read(byte[] b, int off, int len) throws java.io.IOException 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:
java.io.IOException
-
getNextEntry
Returns the next entry in the tar file
Returns
TarEntry
Throws
IOException
- Throws:
java.io.IOException
-
closeCurrentEntry
protected void closeCurrentEntry() throws java.io.IOExceptionCloses the current tar entry
Throws
IOException
- Throws:
java.io.IOException
-
skipPad
protected void skipPad() throws java.io.IOExceptionSkips the pad at the end of each tar entry file content
Throws
IOException
- Throws:
java.io.IOException
-
skip
public long skip(long n) throws java.io.IOException Skips 'n' bytes on the InputStream
Overrides default implementation of skip
- Overrides:
skipin classBufferedInputStream- Throws:
java.io.IOException
-
isDefaultSkip
public boolean isDefaultSkip() -
setDefaultSkip
public void setDefaultSkip(boolean defaultSkip)
-