eu.reservoir.monitoring.distribution
Class XDRDataInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by java.io.FilterInputStream
          extended by eu.reservoir.monitoring.distribution.XDRDataInputStream
All Implemented Interfaces:
java.io.Closeable, java.io.DataInput

public class XDRDataInputStream
extends java.io.FilterInputStream
implements java.io.DataInput

An InputStream that has XDR encoded data in it.


Field Summary
 
Fields inherited from class java.io.FilterInputStream
in
 
Constructor Summary
XDRDataInputStream(java.io.InputStream ins)
          Construct an XDRDataInputStream.
 
Method Summary
 boolean readBoolean()
          Get a boolean from the stream.
 byte readByte()
          Get a byte from the stream.
 byte[] readBytes()
          Get a counted (ie variable length) array of bytes from the stream.
 char readChar()
          Get a char from the stream.
 double readDouble()
          Get a double from the stream.
 byte[] readFixed(int len)
          Get a fixed array of bytes from the stream.
 float readFloat()
          Get a float from the stream.
 void readFully(byte[] b)
          Reads some bytes from an input stream and stores them into the buffer array b.
 void readFully(byte[] b, int off, int len)
          Reads len bytes from an input stream.
 int readInt()
          Get an integer from the stream.
 java.lang.String readLine()
          Read a line from the input.
 long readLong()
          Get a long from the stream.
 short readShort()
          Get a short from the stream.
 java.lang.String readStream()
          Read a string from the stream.
 int readUnsignedByte()
          Get a byte from the stream.
 int readUnsignedShort()
          Get a short from the stream.
 java.lang.String readUTF()
          Read a string from the stream.
 int skipBytes(int n)
          Make an attempt to skip some bytes in the input.
 
Methods inherited from class java.io.FilterInputStream
available, close, mark, markSupported, read, read, read, reset, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XDRDataInputStream

public XDRDataInputStream(java.io.InputStream ins)
Construct an XDRDataInputStream.

Method Detail

readBoolean

public boolean readBoolean()
                    throws java.io.IOException
Get a boolean from the stream. 4 bytes will be input.

Specified by:
readBoolean in interface java.io.DataInput
Throws:
java.io.IOException

readByte

public byte readByte()
              throws java.io.IOException
Get a byte from the stream. 4 bytes will be input.

Specified by:
readByte in interface java.io.DataInput
Throws:
java.io.IOException

readUnsignedByte

public int readUnsignedByte()
                     throws java.io.IOException
Get a byte from the stream. 4 bytes will be input.

Specified by:
readUnsignedByte in interface java.io.DataInput
Throws:
java.io.IOException

readChar

public char readChar()
              throws java.io.IOException
Get a char from the stream. 4 bytes will be input.

Specified by:
readChar in interface java.io.DataInput
Throws:
java.io.IOException

readShort

public short readShort()
                throws java.io.IOException
Get a short from the stream. 4 bytes will be input.

Specified by:
readShort in interface java.io.DataInput
Throws:
java.io.IOException

readUnsignedShort

public int readUnsignedShort()
                      throws java.io.IOException
Get a short from the stream. 4 bytes will be input.

Specified by:
readUnsignedShort in interface java.io.DataInput
Throws:
java.io.IOException

readInt

public int readInt()
            throws java.io.IOException
Get an integer from the stream. 4 bytes will be input.

Specified by:
readInt in interface java.io.DataInput
Throws:
java.io.IOException

readLong

public long readLong()
              throws java.io.IOException
Get a long from the stream. 8 bytes will be input.

Specified by:
readLong in interface java.io.DataInput
Throws:
java.io.IOException

readFloat

public float readFloat()
                throws java.io.IOException
Get a float from the stream. 4 bytes will be input.

Specified by:
readFloat in interface java.io.DataInput
Throws:
java.io.IOException

readDouble

public double readDouble()
                  throws java.io.IOException
Get a double from the stream. 4 bytes will be input.

Specified by:
readDouble in interface java.io.DataInput
Throws:
java.io.IOException

readBytes

public byte[] readBytes()
                 throws java.io.IOException
Get a counted (ie variable length) array of bytes from the stream. The number of bytes consumed will be 4 (for the length) plus the number of bytes in the array, padded to the next multiple of 4.

Throws:
java.io.IOException

readFully

public void readFully(byte[] b)
               throws java.io.IOException
Reads some bytes from an input stream and stores them into the buffer array b. The number of bytes read is equal to the length of b.

Specified by:
readFully in interface java.io.DataInput
Throws:
java.io.IOException

readFully

public void readFully(byte[] b,
                      int off,
                      int len)
               throws java.io.IOException
Reads len bytes from an input stream.

Specified by:
readFully in interface java.io.DataInput
Throws:
java.io.IOException

readStream

public java.lang.String readStream()
                            throws java.io.IOException
Read a string from the stream.

Throws:
java.io.IOException

readUTF

public java.lang.String readUTF()
                         throws java.io.IOException
Read a string from the stream. For DataInput.

Specified by:
readUTF in interface java.io.DataInput
Throws:
java.io.IOException

readLine

public java.lang.String readLine()
                          throws java.io.IOException
Read a line from the input.

Specified by:
readLine in interface java.io.DataInput
Throws:
java.io.IOException

readFixed

public byte[] readFixed(int len)
                 throws java.io.IOException
Get a fixed array of bytes from the stream. The number of bytes consumed number of bytes in the array, padded to the next multiple of 4.

Throws:
java.io.IOException

skipBytes

public int skipBytes(int n)
              throws java.io.IOException
Make an attempt to skip some bytes in the input.

Specified by:
skipBytes in interface java.io.DataInput
Throws:
java.io.IOException


RESERVOIR Monitoring 0.6.4