PDF Clown
0.1.2

org.pdfclown.bytes
Class FileInputStream

java.lang.Object
  extended by org.pdfclown.bytes.FileInputStream
All Implemented Interfaces:
Closeable, IInputStream, IStream, IDataWrapper

public final class FileInputStream
extends Object
implements IInputStream

File stream.

Version:
0.1.0
Author:
Stefano Chizzolini (http://www.stefanochizzolini.it)

Constructor Summary
FileInputStream(RandomAccessFile file)
           
 
Method Summary
 void close()
           
protected  void finalize()
           
 ByteOrder getByteOrder()
          Gets the byte order.
 long getLength()
          Gets the length of the stream.
 long getPosition()
          Gets the pointer position.
 int hashCode()
          Gets the hash representation of the sequence.
 void read(byte[] data)
          Reads a sequence of bytes.
 void read(byte[] data, int offset, int length)
          Reads a sequence of bytes.
 byte readByte()
          Reads a byte.
 int readInt()
          Reads an integer.
 int readInt(int length)
          Reads a variable-length integer.
 String readLine()
          Reads the next line of text.
 short readShort()
          Reads a short integer.
 String readString(int length)
          Reads a string.
 int readUnsignedByte()
          Reads an unsigned byte integer.
 int readUnsignedShort()
          Reads an unsigned short integer.
 void seek(long offset)
          Sets the pointer absolute position.
 void setByteOrder(ByteOrder value)
          Sets the byte order.
 void setPosition(long value)
          Sets the pointer position.
 void skip(long offset)
          Sets the pointer relative position.
 byte[] toByteArray()
          Gets the buffer data copied to a newly-allocated byte array.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileInputStream

public FileInputStream(RandomAccessFile file)
Method Detail

getByteOrder

public ByteOrder getByteOrder()
Description copied from interface: IInputStream
Gets the byte order.

Specified by:
getByteOrder in interface IInputStream

getPosition

public long getPosition()
Description copied from interface: IInputStream
Gets the pointer position.

Specified by:
getPosition in interface IInputStream

hashCode

public int hashCode()
Description copied from interface: IInputStream
Gets the hash representation of the sequence.

Specified by:
hashCode in interface IInputStream
Overrides:
hashCode in class Object

read

public void read(byte[] data)
          throws EOFException
Description copied from interface: IInputStream
Reads a sequence of bytes.

This operation causes the stream pointer to advance after the read data.

Specified by:
read in interface IInputStream
Parameters:
data - Target byte array.
Throws:
EOFException

read

public void read(byte[] data,
                 int offset,
                 int length)
          throws EOFException
Description copied from interface: IInputStream
Reads a sequence of bytes.

This operation causes the stream pointer to advance after the read data.

Specified by:
read in interface IInputStream
Parameters:
data - Target byte array.
offset - Location in the byte array at which storing begins.
length - Number of bytes to read.
Throws:
EOFException

readByte

public byte readByte()
              throws EOFException
Description copied from interface: IInputStream
Reads a byte.

This operation causes the stream pointer to advance after the read data.

Specified by:
readByte in interface IInputStream
Throws:
EOFException

readInt

public int readInt()
            throws EOFException
Description copied from interface: IInputStream
Reads an integer.

This operation causes the stream pointer to advance after the read data.

Specified by:
readInt in interface IInputStream
Throws:
EOFException

readInt

public int readInt(int length)
            throws EOFException
Description copied from interface: IInputStream
Reads a variable-length integer.

This operation causes the stream pointer to advance after the read data.

Specified by:
readInt in interface IInputStream
Parameters:
length - Number of bytes to read.
Throws:
EOFException

readLine

public String readLine()
                throws EOFException
Description copied from interface: IInputStream
Reads the next line of text.

This operation causes the stream pointer to advance after the read data.

Specified by:
readLine in interface IInputStream
Throws:
EOFException

readShort

public short readShort()
                throws EOFException
Description copied from interface: IInputStream
Reads a short integer.

This operation causes the stream pointer to advance after the read data.

Specified by:
readShort in interface IInputStream
Throws:
EOFException

readString

public String readString(int length)
                  throws EOFException
Description copied from interface: IInputStream
Reads a string.

This operation causes the stream pointer to advance after the read data.

Specified by:
readString in interface IInputStream
Parameters:
length - Number of bytes to read.
Throws:
EOFException

readUnsignedByte

public int readUnsignedByte()
                     throws EOFException
Description copied from interface: IInputStream
Reads an unsigned byte integer.

This operation causes the stream pointer to advance after the read data.

Specified by:
readUnsignedByte in interface IInputStream
Throws:
EOFException

readUnsignedShort

public int readUnsignedShort()
                      throws EOFException
Description copied from interface: IInputStream
Reads an unsigned short integer.

This operation causes the stream pointer to advance after the read data.

Specified by:
readUnsignedShort in interface IInputStream
Throws:
EOFException

seek

public void seek(long offset)
Description copied from interface: IInputStream
Sets the pointer absolute position.

Specified by:
seek in interface IInputStream

setByteOrder

public void setByteOrder(ByteOrder value)
Description copied from interface: IInputStream
Sets the byte order.

Specified by:
setByteOrder in interface IInputStream

setPosition

public void setPosition(long value)
Description copied from interface: IInputStream
Sets the pointer position.

Specified by:
setPosition in interface IInputStream

skip

public void skip(long offset)
Description copied from interface: IInputStream
Sets the pointer relative position.

Specified by:
skip in interface IInputStream

toByteArray

public byte[] toByteArray()
Description copied from interface: IDataWrapper
Gets the buffer data copied to a newly-allocated byte array.

Specified by:
toByteArray in interface IDataWrapper

getLength

public long getLength()
Description copied from interface: IStream
Gets the length of the stream.

Specified by:
getLength in interface IStream

close

public void close()
           throws IOException
Specified by:
close in interface Closeable
Throws:
IOException

finalize

protected void finalize()
                 throws Throwable
Overrides:
finalize in class Object
Throws:
Throwable

PDF Clown
0.1.2

Project home page

Copyright © 2006-2013 Stefano Chizzolini. Some Rights Reserved.
This documentation is available under the terms of the GNU Free Documentation License.