sisc.ser
Class BufferedRandomAccessInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by sisc.ser.SeekableInputStream
          extended by sisc.ser.BufferedRandomAccessInputStream
All Implemented Interfaces:
java.io.Closeable, Seekable

public class BufferedRandomAccessInputStream
extends SeekableInputStream


Field Summary
protected  byte[][] buffer
           
protected  int bufferPtr
           
protected  int bufferSize
           
protected  int[][] dirtyRange
           
protected  int[] eofAt
           
protected  long[] offset
           
protected  java.io.RandomAccessFile raf
           
protected  int stackDepth
           
 
Constructor Summary
BufferedRandomAccessInputStream(java.io.File f, java.lang.String mode, int stackDepth, int bufferSize)
           
BufferedRandomAccessInputStream(java.lang.String name, java.lang.String mode)
           
BufferedRandomAccessInputStream(java.lang.String name, java.lang.String mode, int bufferSize)
           
BufferedRandomAccessInputStream(java.lang.String name, java.lang.String mode, int stackDepth, int bufferSize)
           
 
Method Summary
protected  void acquire(long pos)
           
protected  void activate(int bufferNumber, int off)
          Set an existing buffer as the active buffer and set the buffer pointer
protected  void advance()
           
protected  void advancePointer(int n)
           
protected  void advancePointerWrite(int n)
           
 void close()
           
 void flush()
           
protected  void flush(int bufferNumber)
           
 long getFilePointer()
           
protected  void load(long pos)
           
static void main(java.lang.String[] args)
           
 int read()
           
 int read(byte[] b)
           
 int read(byte[] b, int off, int len)
           
 void seek(long pos)
           
 int skipBytes(int n)
           
 void write(byte[] b)
           
 void write(byte[] b, int off, int len)
           
 void write(int b)
           
 
Methods inherited from class java.io.InputStream
available, mark, markSupported, reset, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

raf

protected java.io.RandomAccessFile raf

stackDepth

protected int stackDepth

bufferSize

protected int bufferSize

buffer

protected byte[][] buffer

dirtyRange

protected int[][] dirtyRange

eofAt

protected int[] eofAt

offset

protected long[] offset

bufferPtr

protected int bufferPtr
Constructor Detail

BufferedRandomAccessInputStream

public BufferedRandomAccessInputStream(java.lang.String name,
                                       java.lang.String mode)
                                throws java.io.IOException
Throws:
java.io.IOException

BufferedRandomAccessInputStream

public BufferedRandomAccessInputStream(java.lang.String name,
                                       java.lang.String mode,
                                       int bufferSize)
                                throws java.io.IOException
Throws:
java.io.IOException

BufferedRandomAccessInputStream

public BufferedRandomAccessInputStream(java.lang.String name,
                                       java.lang.String mode,
                                       int stackDepth,
                                       int bufferSize)
                                throws java.io.IOException
Throws:
java.io.IOException

BufferedRandomAccessInputStream

public BufferedRandomAccessInputStream(java.io.File f,
                                       java.lang.String mode,
                                       int stackDepth,
                                       int bufferSize)
                                throws java.io.IOException
Throws:
java.io.IOException
Method Detail

flush

protected void flush(int bufferNumber)
              throws java.io.IOException
Throws:
java.io.IOException

flush

public void flush()
           throws java.io.IOException
Throws:
java.io.IOException

activate

protected void activate(int bufferNumber,
                        int off)
Set an existing buffer as the active buffer and set the buffer pointer


load

protected void load(long pos)
             throws java.io.IOException
Throws:
java.io.IOException

advance

protected final void advance()
                      throws java.io.IOException
Throws:
java.io.IOException

acquire

protected void acquire(long pos)
                throws java.io.IOException
Throws:
java.io.IOException

advancePointer

protected final void advancePointer(int n)
                             throws java.io.IOException
Throws:
java.io.IOException

advancePointerWrite

protected final void advancePointerWrite(int n)
                                  throws java.io.IOException
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[] b,
                int off,
                int len)
         throws java.io.IOException
Overrides:
read in class java.io.InputStream
Throws:
java.io.IOException

read

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

skipBytes

public int skipBytes(int n)
              throws java.io.IOException
Throws:
java.io.IOException

write

public void write(int b)
           throws java.io.IOException
Throws:
java.io.IOException

write

public void write(byte[] b,
                  int off,
                  int len)
           throws java.io.IOException
Throws:
java.io.IOException

write

public void write(byte[] b)
           throws java.io.IOException
Throws:
java.io.IOException

getFilePointer

public long getFilePointer()
                    throws java.io.IOException
Throws:
java.io.IOException

seek

public void seek(long pos)
          throws java.io.IOException
Throws:
java.io.IOException

main

public static void main(java.lang.String[] args)
                 throws java.io.IOException
Throws:
java.io.IOException