com.lowagie.text.pdf
Class RandomAccessFileOrArray

java.lang.Object
  |
  +--com.lowagie.text.pdf.RandomAccessFileOrArray
All Implemented Interfaces:
DataInput

public class RandomAccessFileOrArray
extends Object
implements DataInput

An implementation of a RandomAccessFile for input only that accepts a file or a byte array as data source.

Author:
Paulo Soares (psoares@consiste.pt)

Field Summary
(package private)  byte[] arrayIn
           
(package private)  int arrayInPtr
           
(package private)  byte back
           
(package private)  String filename
           
(package private)  boolean isBack
           
(package private)  RandomAccessFile rf
           
 
Constructor Summary
RandomAccessFileOrArray(byte[] arrayIn)
           
RandomAccessFileOrArray(RandomAccessFileOrArray file)
           
RandomAccessFileOrArray(String filename)
           
 
Method Summary
 void close()
           
 int getFilePointer()
           
protected  void insureOpen()
           
 int length()
           
 void pushBack(byte b)
           
 int read()
           
 int read(byte[] b)
           
 int read(byte[] b, int off, int len)
           
 boolean readBoolean()
           
 byte readByte()
           
 char readChar()
           
 double readDouble()
           
 float readFloat()
           
 void readFully(byte[] b)
           
 void readFully(byte[] b, int off, int len)
           
 int readInt()
           
 String readLine()
           
 long readLong()
           
 short readShort()
           
 int readUnsignedByte()
           
 int readUnsignedShort()
           
 String readUTF()
           
 void reOpen()
           
 void seek(int pos)
           
 int skipBytes(int n)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

rf

RandomAccessFile rf

filename

String filename

arrayIn

byte[] arrayIn

arrayInPtr

int arrayInPtr

back

byte back

isBack

boolean isBack
Constructor Detail

RandomAccessFileOrArray

public RandomAccessFileOrArray(String filename)
                        throws IOException

RandomAccessFileOrArray

public RandomAccessFileOrArray(byte[] arrayIn)

RandomAccessFileOrArray

public RandomAccessFileOrArray(RandomAccessFileOrArray file)
Method Detail

pushBack

public void pushBack(byte b)

read

public int read()
         throws IOException
IOException

read

public int read(byte[] b,
                int off,
                int len)
         throws IOException
IOException

read

public int read(byte[] b)
         throws IOException
IOException

readFully

public void readFully(byte[] b)
               throws IOException
Specified by:
readFully in interface DataInput
IOException

readFully

public void readFully(byte[] b,
                      int off,
                      int len)
               throws IOException
Specified by:
readFully in interface DataInput
IOException

skipBytes

public int skipBytes(int n)
              throws IOException
Specified by:
skipBytes in interface DataInput
IOException

reOpen

public void reOpen()
            throws IOException
IOException

insureOpen

protected void insureOpen()
                   throws IOException
IOException

close

public void close()
           throws IOException
IOException

length

public int length()
           throws IOException
IOException

seek

public void seek(int pos)
          throws IOException
IOException

getFilePointer

public int getFilePointer()
                   throws IOException
IOException

readBoolean

public boolean readBoolean()
                    throws IOException
Specified by:
readBoolean in interface DataInput
IOException

readByte

public byte readByte()
              throws IOException
Specified by:
readByte in interface DataInput
IOException

readUnsignedByte

public int readUnsignedByte()
                     throws IOException
Specified by:
readUnsignedByte in interface DataInput
IOException

readShort

public short readShort()
                throws IOException
Specified by:
readShort in interface DataInput
IOException

readUnsignedShort

public int readUnsignedShort()
                      throws IOException
Specified by:
readUnsignedShort in interface DataInput
IOException

readChar

public char readChar()
              throws IOException
Specified by:
readChar in interface DataInput
IOException

readInt

public int readInt()
            throws IOException
Specified by:
readInt in interface DataInput
IOException

readLong

public long readLong()
              throws IOException
Specified by:
readLong in interface DataInput
IOException

readFloat

public float readFloat()
                throws IOException
Specified by:
readFloat in interface DataInput
IOException

readDouble

public double readDouble()
                  throws IOException
Specified by:
readDouble in interface DataInput
IOException

readLine

public String readLine()
                throws IOException
Specified by:
readLine in interface DataInput
IOException

readUTF

public String readUTF()
               throws IOException
Specified by:
readUTF in interface DataInput
IOException