uka.transport
Class BinaryReader

java.lang.Object
  extended byuka.transport.BinaryReader
All Implemented Interfaces:
TransportConstants

public class BinaryReader
extends java.lang.Object
implements TransportConstants

Author:
Bernhard Haumacher

Field Summary
protected  byte[] buf
           
protected  int bufcnt
           
protected  int buflen
           
(package private)  java.lang.StringBuffer cbuffer
           
protected  java.io.InputStream in
           
 
Fields inherited from interface uka.transport.TransportConstants
REQUEST_MAX, REQUEST_MAX_boolean, REQUEST_MAX_byte, REQUEST_MAX_char, REQUEST_MAX_double, REQUEST_MAX_float, REQUEST_MAX_int, REQUEST_MAX_long, REQUEST_MAX_short, SIZEOF_boolean, SIZEOF_byte, SIZEOF_char, SIZEOF_double, SIZEOF_float, SIZEOF_int, SIZEOF_long, SIZEOF_short, TC_ANONYMOUS, TC_DEFAULT, TC_EXCEPTION, TC_NEW, TC_NULL, TC_REFERENCE, TC_REPLACEMENT, TC_RESET, TC_RESETTYPE, TC_TYPE, TC_USER
 
Constructor Summary
BinaryReader(java.io.InputStream in)
           
 
Method Summary
 void accept(int length)
           
 int available()
           
 void close()
           
 byte[] getBuffer()
           
 int getPosition()
           
 int read()
           
 int read(byte[] data)
           
 int read(byte[] data, int _offset, int length)
           
 boolean readBoolean()
           
 byte readByte()
           
 char readChar()
           
 java.lang.String readChars()
           
 double readDouble()
           
 float readFloat()
           
 void readFully(byte[] data)
           
 void readFully(byte[] data, int offset, int length)
           
protected  void readHugeBooleanArray(boolean[] array, int offset, int length)
           
protected  void readHugeByteArray(byte[] array, int offset, int length)
           
protected  void readHugeCharArray(char[] array, int offset, int length)
           
protected  void readHugeDoubleArray(double[] array, int offset, int length)
           
protected  void readHugeFloatArray(float[] array, int offset, int length)
           
protected  void readHugeIntArray(int[] array, int offset, int length)
           
protected  void readHugeLongArray(long[] array, int offset, int length)
           
protected  void readHugeShortArray(short[] array, int offset, int length)
           
 int readInt()
           
 long readLong()
           
 short readShort()
           
 int readUnsignedByte()
           
 int readUnsignedShort()
           
 void request(int length)
           
private  int requestTest(int length)
           
 long skip(long n)
           
 int skipBytes(int n)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

in

protected java.io.InputStream in

buflen

protected int buflen

bufcnt

protected int bufcnt

buf

protected byte[] buf

cbuffer

java.lang.StringBuffer cbuffer
Constructor Detail

BinaryReader

public BinaryReader(java.io.InputStream in)
Method Detail

available

public int available()
              throws java.io.IOException
Throws:
java.io.IOException

close

public void close()
           throws java.io.IOException
Throws:
java.io.IOException

read

public int read()
         throws java.io.IOException
Throws:
java.io.IOException

read

public int read(byte[] data)
         throws java.io.IOException
Throws:
java.io.IOException

read

public int read(byte[] data,
                int _offset,
                int length)
         throws java.io.IOException
Throws:
java.io.IOException

skip

public long skip(long n)
          throws java.io.IOException
Throws:
java.io.IOException

skipBytes

public int skipBytes(int n)
              throws java.io.IOException
Throws:
java.io.IOException

readFully

public void readFully(byte[] data)
               throws java.io.IOException
Throws:
java.io.IOException

readFully

public final void readFully(byte[] data,
                            int offset,
                            int length)
                     throws java.io.IOException
Throws:
java.io.IOException

readChars

public java.lang.String readChars()
                           throws java.io.IOException
Throws:
java.io.IOException

readHugeByteArray

protected void readHugeByteArray(byte[] array,
                                 int offset,
                                 int length)
                          throws java.io.IOException
Throws:
java.io.IOException
See Also:
BinaryOutputStream.writeHugeByteArray(byte[], int, int)

readHugeIntArray

protected void readHugeIntArray(int[] array,
                                int offset,
                                int length)
                         throws java.io.IOException
Throws:
java.io.IOException
See Also:
BinaryOutputStream.writeHugeDoubleArray(double[], int, int)

readHugeCharArray

protected void readHugeCharArray(char[] array,
                                 int offset,
                                 int length)
                          throws java.io.IOException
Throws:
java.io.IOException
See Also:
BinaryOutputStream.writeHugeDoubleArray(double[], int, int)

readHugeFloatArray

protected void readHugeFloatArray(float[] array,
                                  int offset,
                                  int length)
                           throws java.io.IOException
Throws:
java.io.IOException
See Also:
BinaryOutputStream.writeHugeDoubleArray(double[], int, int)

readHugeLongArray

protected void readHugeLongArray(long[] array,
                                 int offset,
                                 int length)
                          throws java.io.IOException
Throws:
java.io.IOException
See Also:
BinaryOutputStream.writeHugeDoubleArray(double[], int, int)

readHugeDoubleArray

protected void readHugeDoubleArray(double[] array,
                                   int offset,
                                   int length)
                            throws java.io.IOException
Throws:
java.io.IOException
See Also:
BinaryOutputStream.writeHugeDoubleArray(double[], int, int)

readHugeShortArray

protected void readHugeShortArray(short[] array,
                                  int offset,
                                  int length)
                           throws java.io.IOException
Throws:
java.io.IOException
See Also:
BinaryOutputStream.writeHugeDoubleArray(double[], int, int)

readHugeBooleanArray

protected void readHugeBooleanArray(boolean[] array,
                                    int offset,
                                    int length)
                             throws java.io.IOException
Throws:
java.io.IOException
See Also:
BinaryOutputStream.writeHugeDoubleArray(double[], int, int)

getBuffer

public final byte[] getBuffer()

getPosition

public final int getPosition()

request

public final void request(int length)
                   throws java.io.IOException
Throws:
java.io.IOException

accept

public final void accept(int length)
                  throws java.io.IOException
Throws:
java.io.IOException

requestTest

private final int requestTest(int length)
                       throws java.io.IOException
Throws:
java.io.IOException

readBoolean

public final boolean readBoolean()
                          throws java.io.IOException
Throws:
java.io.IOException

readByte

public final byte readByte()
                    throws java.io.IOException
Throws:
java.io.IOException

readChar

public final char readChar()
                    throws java.io.IOException
Throws:
java.io.IOException

readShort

public final short readShort()
                      throws java.io.IOException
Throws:
java.io.IOException

readInt

public final int readInt()
                  throws java.io.IOException
Throws:
java.io.IOException

readLong

public final long readLong()
                    throws java.io.IOException
Throws:
java.io.IOException

readFloat

public final float readFloat()
                      throws java.io.IOException
Throws:
java.io.IOException

readDouble

public final double readDouble()
                        throws java.io.IOException
Throws:
java.io.IOException

readUnsignedShort

public final int readUnsignedShort()
                            throws java.io.IOException
Throws:
java.io.IOException

readUnsignedByte

public final int readUnsignedByte()
                           throws java.io.IOException
Throws:
java.io.IOException