org.icepdf.core.io
Class RandomAccessFileInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by org.icepdf.core.io.RandomAccessFileInputStream
All Implemented Interfaces:
java.io.Closeable, SeekableInput

public class RandomAccessFileInputStream
extends java.io.InputStream
implements SeekableInput

Since:
2.0
Author:
Mark Collette

Constructor Summary
protected RandomAccessFileInputStream(java.io.RandomAccessFile raf)
           
 
Method Summary
 int available()
           
 void beginThreadAccess()
           
static RandomAccessFileInputStream build(java.io.File file)
           
 void close()
           
 void endThreadAccess()
           
 long getAbsolutePosition()
           
 java.io.InputStream getInputStream()
           
 long getLength()
           
 void mark(int readLimit)
           
 boolean markSupported()
           
 int read()
           
 int read(byte[] buffer)
           
 int read(byte[] buffer, int offset, int length)
           
 void reset()
           
 void seekAbsolute(long absolutePosition)
           
 void seekEnd()
           
 void seekRelative(long relativeOffset)
           
 long skip(long n)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RandomAccessFileInputStream

protected RandomAccessFileInputStream(java.io.RandomAccessFile raf)
Method Detail

build

public static RandomAccessFileInputStream build(java.io.File file)
                                         throws java.io.FileNotFoundException
Throws:
java.io.FileNotFoundException

read

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

read

public int read(byte[] buffer)
         throws java.io.IOException
Specified by:
read in interface SeekableInput
Overrides:
read in class java.io.InputStream
Throws:
java.io.IOException

read

public int read(byte[] buffer,
                int offset,
                int length)
         throws java.io.IOException
Specified by:
read in interface SeekableInput
Overrides:
read 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
Specified by:
close in interface SeekableInput
Overrides:
close in class java.io.InputStream
Throws:
java.io.IOException

available

public int available()
Specified by:
available in interface SeekableInput
Overrides:
available in class java.io.InputStream

mark

public void mark(int readLimit)
Specified by:
mark in interface SeekableInput
Overrides:
mark in class java.io.InputStream

markSupported

public boolean markSupported()
Specified by:
markSupported in interface SeekableInput
Overrides:
markSupported in class java.io.InputStream

reset

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

skip

public long skip(long n)
          throws java.io.IOException
Specified by:
skip in interface SeekableInput
Overrides:
skip in class java.io.InputStream
Throws:
java.io.IOException

seekAbsolute

public void seekAbsolute(long absolutePosition)
                  throws java.io.IOException
Specified by:
seekAbsolute in interface SeekableInput
Throws:
java.io.IOException

seekRelative

public void seekRelative(long relativeOffset)
                  throws java.io.IOException
Specified by:
seekRelative in interface SeekableInput
Throws:
java.io.IOException

seekEnd

public void seekEnd()
             throws java.io.IOException
Specified by:
seekEnd in interface SeekableInput
Throws:
java.io.IOException

getAbsolutePosition

public long getAbsolutePosition()
                         throws java.io.IOException
Specified by:
getAbsolutePosition in interface SeekableInput
Throws:
java.io.IOException

getLength

public long getLength()
               throws java.io.IOException
Specified by:
getLength in interface SeekableInput
Throws:
java.io.IOException

getInputStream

public java.io.InputStream getInputStream()
Specified by:
getInputStream in interface SeekableInput

beginThreadAccess

public void beginThreadAccess()
Specified by:
beginThreadAccess in interface SeekableInput

endThreadAccess

public void endThreadAccess()
Specified by:
endThreadAccess in interface SeekableInput