org.apache.james.util.io
Class ResettableFileInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by org.apache.james.util.io.ResettableFileInputStream
All Implemented Interfaces:
java.io.Closeable

public class ResettableFileInputStream
extends java.io.InputStream

Author:
Federico Barbieri

Field Summary
protected static int DEFAULT_BUFFER_SIZE
           
protected  int m_bufferSize
           
protected  java.lang.String m_filename
           
protected  java.io.InputStream m_inputStream
           
protected  boolean m_isMarkSet
           
protected  long m_mark
           
protected  long m_position
           
 
Constructor Summary
ResettableFileInputStream(java.io.File file)
           
ResettableFileInputStream(java.lang.String filename)
           
ResettableFileInputStream(java.lang.String filename, int bufferSize)
           
 
Method Summary
 int available()
           
 void close()
           
 void mark(int readLimit)
           
 boolean markSupported()
           
protected  java.io.InputStream newStream()
           
 int read()
           
 int read(byte[] bytes, int offset, int length)
           
 void reset()
           
 long skip(long count)
           
 
Methods inherited from class java.io.InputStream
read
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_BUFFER_SIZE

protected static final int DEFAULT_BUFFER_SIZE
See Also:
Constant Field Values

m_filename

protected final java.lang.String m_filename

m_bufferSize

protected int m_bufferSize

m_inputStream

protected java.io.InputStream m_inputStream

m_position

protected long m_position

m_mark

protected long m_mark

m_isMarkSet

protected boolean m_isMarkSet
Constructor Detail

ResettableFileInputStream

public ResettableFileInputStream(java.io.File file)
                          throws java.io.IOException
Throws:
java.io.IOException

ResettableFileInputStream

public ResettableFileInputStream(java.lang.String filename)
                          throws java.io.IOException
Throws:
java.io.IOException

ResettableFileInputStream

public ResettableFileInputStream(java.lang.String filename,
                                 int bufferSize)
                          throws java.io.IOException
Throws:
java.io.IOException
Method Detail

mark

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

markSupported

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

reset

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

newStream

protected java.io.InputStream newStream()
                                 throws java.io.IOException
Throws:
java.io.IOException

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

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,
                int offset,
                int length)
         throws java.io.IOException
Overrides:
read in class java.io.InputStream
Throws:
java.io.IOException

skip

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


Copyright © 2002-2007 The Apache Software Foundation. All Rights Reserved.