com.liferay.portal.kernel.io
Class ByteArrayFileInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by com.liferay.portal.kernel.io.ByteArrayFileInputStream
All Implemented Interfaces:
java.io.Closeable

public class ByteArrayFileInputStream
extends java.io.InputStream

Author:
Shuyang Zhou

Field Summary
protected  byte[] data
           
protected  boolean deleteOnClose
           
protected  java.io.File file
           
protected  java.io.FileInputStream fileInputStream
           
protected  long fileSize
           
protected  int index
           
protected  int markIndex
           
protected  int threshold
           
 
Constructor Summary
ByteArrayFileInputStream(java.io.File file, int threshold)
           
ByteArrayFileInputStream(java.io.File file, int threshold, boolean deleteOnClose)
           
 
Method Summary
 int available()
           
 void close()
           
 java.io.File getFile()
           
protected  void initData()
           
protected  void initFileInputStream()
           
 void mark(int readLimit)
           
 boolean markSupported()
           
 int read()
           
 int read(byte[] bytes)
           
 int read(byte[] bytes, int offset, int length)
           
 void reset()
           
 long skip(long skip)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

data

protected byte[] data

deleteOnClose

protected boolean deleteOnClose

file

protected java.io.File file

fileInputStream

protected java.io.FileInputStream fileInputStream

fileSize

protected long fileSize

index

protected int index

markIndex

protected int markIndex

threshold

protected int threshold
Constructor Detail

ByteArrayFileInputStream

public ByteArrayFileInputStream(java.io.File file,
                                int threshold)

ByteArrayFileInputStream

public ByteArrayFileInputStream(java.io.File file,
                                int threshold,
                                boolean deleteOnClose)
Method Detail

available

public int available()
              throws java.io.IOException
Overrides:
available in class java.io.InputStream
Throws:
java.io.IOException

close

public void close()
           throws java.io.IOException
Specified by:
close in interface java.io.Closeable
Overrides:
close in class java.io.InputStream
Throws:
java.io.IOException

getFile

public java.io.File getFile()

mark

public void mark(int readLimit)
Overrides:
mark in class java.io.InputStream

markSupported

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

read

public int read()
         throws java.io.IOException
Specified by:
read in class java.io.InputStream
Throws:
java.io.IOException

read

public int read(byte[] bytes)
         throws java.io.IOException
Overrides:
read in class java.io.InputStream
Throws:
java.io.IOException

read

public int read(byte[] bytes,
                int offset,
                int length)
         throws java.io.IOException
Overrides:
read in class java.io.InputStream
Throws:
java.io.IOException

reset

public void reset()
           throws java.io.IOException
Overrides:
reset in class java.io.InputStream
Throws:
java.io.IOException

skip

public long skip(long skip)
          throws java.io.IOException
Overrides:
skip in class java.io.InputStream
Throws:
java.io.IOException

initData

protected void initData()
                 throws java.io.IOException
Throws:
java.io.IOException

initFileInputStream

protected void initFileInputStream()
                            throws java.io.IOException
Throws:
java.io.IOException