Class prominence.io.MarkResetFileInputStream
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class prominence.io.MarkResetFileInputStream

java.lang.Object
   |
   +----java.io.InputStream
           |
           +----java.io.FileInputStream
                   |
                   +----prominence.io.MarkResetFileInputStream

public class MarkResetFileInputStream
extends FileInputStream
A FileInputStream that supports the mark() and reset() methods.

Variable Index

 o file
The file that is being read.
 o markedPos
The last market position in the file.

Constructor Index

 o MarkResetFileInputStream(RandomAccessFile)
Creates a MarkResetFileInputStream that reads from the specified RandomAccessFile.

Method Index

 o create(String)
This method creates a new MarkResetFileInputStream that reads from the specified file.
 o mark(int)
Marks the current position in the file.
 o markSupported()
Returns that the mark() and reset() methods are supported.
 o reset()
Resets the file pointer to the previously marked position.

Variables

 o markedPos
  protected long markedPos
The last market position in the file.
 o file
  protected RandomAccessFile file
The file that is being read.

Constructors

 o MarkResetFileInputStream
  public MarkResetFileInputStream(RandomAccessFile file)
Creates a MarkResetFileInputStream that reads from the specified RandomAccessFile.
Parameters:
file - The RandomAccessFile to read from

Methods

 o create
  public static MarkResetFileInputStream create(String fileName) throws IOException
This method creates a new MarkResetFileInputStream that reads from the specified file.
Parameters:
fileName - The name of the file to read
Returns:
A new MarkResetFileInputStream
Throws: IOException
Occurs if the file cannot be opened for reading.
Throws: SecurityException
Occurs if the SecurityManager denies the operation.
 o markSupported
  public boolean markSupported()
Returns that the mark() and reset() methods are supported.
Overrides:
markSupported in class InputStream
 o mark
  public void mark(int n)
Marks the current position in the file.
Parameters:
n - The maximum number of bytes that may be read before reset() is called
Overrides:
mark in class InputStream
 o reset
  public void reset() throws IOException
Resets the file pointer to the previously marked position.
Throws: IOException
Occurs if no mark has been set or if an error occurs while resetting the position.
Overrides:
reset in class InputStream

All Packages  Class Hierarchy  This Package  Previous  Next  Index