PDF Clown
0.0.8

it.stefanochizzolini.clown.bytes
Class FileInputStream

java.lang.Object
  extended by it.stefanochizzolini.clown.bytes.FileInputStream
All Implemented Interfaces:
IInputStream, IStream, Closeable

public final class FileInputStream
extends Object
implements IInputStream

File stream.

Version:
0.0.8
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 from the stream and advances the position within the stream.
 void read(byte[] data, int offset, int length)
          Reads a sequence of bytes from the stream and advances the position within the stream.
 byte readByte()
          Reads a byte from the stream and advances the position within the stream.
 int readInt()
          Reads an integer from the stream and advances the position within the stream.
 String readLine()
          Reads the next line of text.
 short readShort()
          Reads a short integer from the stream and advances the position within the stream.
 String readString(int length)
          Reads a string from the stream and advances the position within the stream.
 int readUnsignedByte()
          Reads an unsigned byte integer from the stream and advances the position within the stream.
 int readUnsignedShort()
          Reads an unsigned short integer from the stream and advances the position within the stream.
 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 from the stream and advances the position within the stream.

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 from the stream and advances the position within the stream.

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 copy.
Throws:
EOFException

readByte

public byte readByte()
              throws EOFException
Description copied from interface: IInputStream
Reads a byte from the stream and advances the position within the stream.

Specified by:
readByte in interface IInputStream
Returns:
Byte from the stream.
Throws:
EOFException

readInt

public int readInt()
            throws EOFException
Description copied from interface: IInputStream
Reads an integer from the stream and advances the position within the stream.

Specified by:
readInt in interface IInputStream
Returns:
Integer from the stream.
Throws:
EOFException

readLine

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

Specified by:
readLine in interface IInputStream
Returns:
String from the stream.
Throws:
EOFException

readShort

public short readShort()
                throws EOFException
Description copied from interface: IInputStream
Reads a short integer from the stream and advances the position within the stream.

Specified by:
readShort in interface IInputStream
Returns:
Short integer from the stream.
Throws:
EOFException

readString

public String readString(int length)
                  throws EOFException
Description copied from interface: IInputStream
Reads a string from the stream and advances the position within the stream.

Specified by:
readString in interface IInputStream
Parameters:
length - Number of bytes to read.
Returns:
String from the stream.
Throws:
EOFException

readUnsignedByte

public int readUnsignedByte()
                     throws EOFException
Description copied from interface: IInputStream
Reads an unsigned byte integer from the stream and advances the position within the stream.

Specified by:
readUnsignedByte in interface IInputStream
Returns:
Unsigned byte integer from the stream.
Throws:
EOFException

readUnsignedShort

public int readUnsignedShort()
                      throws EOFException
Description copied from interface: IInputStream
Reads an unsigned short integer from the stream and advances the position within the stream.

Specified by:
readUnsignedShort in interface IInputStream
Returns:
Unsigned short integer from the stream.
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: IInputStream
Gets the buffer data copied to a newly-allocated byte array.

Specified by:
toByteArray in interface IInputStream

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.0.8

Project home page

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