org.xeustechnologies.jtar
Class TarInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by java.io.FilterInputStream
          extended by org.xeustechnologies.jtar.TarInputStream
All Implemented Interfaces:
java.io.Closeable

public class TarInputStream
extends java.io.FilterInputStream

Author:
Kamran Zafar

Field Summary
 
Fields inherited from class java.io.FilterInputStream
in
 
Constructor Summary
TarInputStream(java.io.InputStream in)
           
 
Method Summary
protected  void closeCurrentEntry()
          Closes the current tar entry
 TarEntry getNextEntry()
          Returns the next entry in the tar file
 boolean isDefaultSkip()
           
 void mark(int readlimit)
          Not supported
 boolean markSupported()
           
 int read()
          Read a byte
 int read(byte[] b, int off, int len)
          Checks if the bytes being read exceed the entry size and adjusts the byte array length.
 void reset()
          Not supported
 void setDefaultSkip(boolean defaultSkip)
           
 long skip(long n)
          Skips 'n' bytes on the InputStream
Overrides default implementation of skip
protected  void skipPad()
          Skips the pad at the end of each tar entry file content
 
Methods inherited from class java.io.FilterInputStream
available, close, read
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TarInputStream

public TarInputStream(java.io.InputStream in)
Method Detail

markSupported

public boolean markSupported()
Overrides:
markSupported in class java.io.FilterInputStream

mark

public void mark(int readlimit)
Not supported

Overrides:
mark in class java.io.FilterInputStream

reset

public void reset()
           throws java.io.IOException
Not supported

Overrides:
reset in class java.io.FilterInputStream
Throws:
java.io.IOException

read

public int read()
         throws java.io.IOException
Read a byte

Overrides:
read in class java.io.FilterInputStream
Throws:
java.io.IOException
See Also:
FilterInputStream.read()

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

Overrides:
read in class java.io.FilterInputStream
Throws:
java.io.IOException
See Also:
FilterInputStream.read(byte[], int, int)

getNextEntry

public TarEntry getNextEntry()
                      throws java.io.IOException
Returns the next entry in the tar file

Returns:
TarEntry
Throws:
java.io.IOException

closeCurrentEntry

protected void closeCurrentEntry()
                          throws java.io.IOException
Closes the current tar entry

Throws:
java.io.IOException

skipPad

protected void skipPad()
                throws java.io.IOException
Skips the pad at the end of each tar entry file content

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:
skip in class java.io.FilterInputStream
Throws:
java.io.IOException

isDefaultSkip

public boolean isDefaultSkip()

setDefaultSkip

public void setDefaultSkip(boolean defaultSkip)


Copyright © 2012 Xeus Technologies. All Rights Reserved.