PDF Clown
0.0.8

it.stefanochizzolini.clown.bytes
Interface IInputStream

All Superinterfaces:
Closeable, IStream
All Known Subinterfaces:
IBuffer
All Known Implementing Classes:
Buffer, FileInputStream

public interface IInputStream
extends IStream

Input stream.

Its pivotal concept is the access pointer.

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

Method Summary
 ByteOrder getByteOrder()
          Gets the byte order.
 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 position)
          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 interface it.stefanochizzolini.clown.bytes.IStream
getLength
 
Methods inherited from interface java.io.Closeable
close
 

Method Detail

getByteOrder

ByteOrder getByteOrder()
Gets the byte order.


getPosition

long getPosition()
Gets the pointer position.


hashCode

int hashCode()
Gets the hash representation of the sequence.

Overrides:
hashCode in class Object

read

void read(byte[] data)
          throws EOFException
Reads a sequence of bytes from the stream and advances the position within the stream.

Parameters:
data - Target byte array.
Throws:
EOFException

read

void read(byte[] data,
          int offset,
          int length)
          throws EOFException
Reads a sequence of bytes from the stream and advances the position within the stream.

Parameters:
data - Target byte array.
offset - Location in the byte array at which storing begins.
length - Number of bytes to copy.
Throws:
EOFException

readByte

byte readByte()
              throws EOFException
Reads a byte from the stream and advances the position within the stream.

Returns:
Byte from the stream.
Throws:
EOFException

readInt

int readInt()
            throws EOFException
Reads an integer from the stream and advances the position within the stream.

Returns:
Integer from the stream.
Throws:
EOFException

readLine

String readLine()
                throws EOFException
Reads the next line of text.

Returns:
String from the stream.
Throws:
EOFException

readShort

short readShort()
                throws EOFException
Reads a short integer from the stream and advances the position within the stream.

Returns:
Short integer from the stream.
Throws:
EOFException

readString

String readString(int length)
                  throws EOFException
Reads a string from the stream and advances the position within the stream.

Parameters:
length - Number of bytes to read.
Returns:
String from the stream.
Throws:
EOFException

readUnsignedByte

int readUnsignedByte()
                     throws EOFException
Reads an unsigned byte integer from the stream and advances the position within the stream.

Returns:
Unsigned byte integer from the stream.
Throws:
EOFException

readUnsignedShort

int readUnsignedShort()
                      throws EOFException
Reads an unsigned short integer from the stream and advances the position within the stream.

Returns:
Unsigned short integer from the stream.
Throws:
EOFException

seek

void seek(long position)
Sets the pointer absolute position.


setByteOrder

void setByteOrder(ByteOrder value)
Sets the byte order.


setPosition

void setPosition(long value)
Sets the pointer position.


skip

void skip(long offset)
Sets the pointer relative position.


toByteArray

byte[] toByteArray()
Gets the buffer data copied to a newly-allocated byte array.


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.