eu.reservoir.monitoring.distribution
Class XDRDataOutputStream

java.lang.Object
  extended by java.io.OutputStream
      extended by java.io.FilterOutputStream
          extended by eu.reservoir.monitoring.distribution.XDRDataOutputStream
All Implemented Interfaces:
java.io.Closeable, java.io.DataOutput, java.io.Flushable

public class XDRDataOutputStream
extends java.io.FilterOutputStream
implements java.io.DataOutput

An OutputStream that has XDR encoded data in it.


Field Summary
 
Fields inherited from class java.io.FilterOutputStream
out
 
Constructor Summary
XDRDataOutputStream(java.io.OutputStream out)
          Construct an XDRDataOutputStream.
 
Method Summary
 int size()
           
 java.lang.String toString()
          To string.
 void write(int b)
          Writes the specified byte to this output stream.
 void writeBoolean(boolean b)
          Put a boolean onto the stream.
 void writeByte(byte b)
          Put a single byte onto the stream.
 void writeByte(int i)
          Put a single byte onto the stream.
 void writeBytes(byte[] data)
          Put a array of bytes onto the stream as a variable length opaque data item.
 void writeBytes(byte[] data, int len)
          Put a array of bytes onto the stream as a variable length opaque data item.
 void writeBytes(byte[] data, int bufferOffset, int len)
          Put a array of bytes onto the stream as a variable length opaque data item.
 void writeBytes(java.lang.String str)
          Put a String represented as a variable length opaque data item.
 void writeChar(char i)
          Put a char onto the stream.
 void writeChar(int i)
          Put a char onto the stream.
 void writeChars(java.lang.String str)
          Put a String represented as a variable length opaque data item.
 void writeDouble(double d)
          Put a double precision floating point number (as 64 bits) onto the stream.
 void writeFixed(byte[] data)
          Put a array of bytes onto the stream as a fixed length opaque data item.
 void writeFixed(byte[] data, int len)
          Put a array of bytes onto the stream as a fixed length opaque data item.
 void writeFixed(byte[] data, int bufferOffset, int len)
          Put a array of bytes onto the stream as a fixed length opaque data item.
 void writeFloat(float f)
          Put a floating point number (as 32 bits) onto the stream.
 void writeInt(int i)
          Put an integer onto the stream.
 void writeLong(long l)
          Put a long onto the stream.
 void writeShort(int i)
          Put a short onto the stream.
 void writeShort(short i)
          Put a short onto the stream.
 void writeString(java.lang.String str)
          Put a String represented as a variable length opaque data item.
 void writeUTF(java.lang.String str)
          Put a String represented as a variable length opaque data item.
 
Methods inherited from class java.io.FilterOutputStream
close, flush, write, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.io.DataOutput
write, write
 

Constructor Detail

XDRDataOutputStream

public XDRDataOutputStream(java.io.OutputStream out)
Construct an XDRDataOutputStream.

Method Detail

write

public void write(int b)
           throws java.io.IOException
Writes the specified byte to this output stream.

Specified by:
write in interface java.io.DataOutput
Overrides:
write in class java.io.FilterOutputStream
Throws:
java.io.IOException

size

public int size()

writeBoolean

public void writeBoolean(boolean b)
                  throws java.io.IOException
Put a boolean onto the stream. A boolean is padded out to 4 bytes.

Specified by:
writeBoolean in interface java.io.DataOutput
Throws:
java.io.IOException

writeByte

public void writeByte(byte b)
               throws java.io.IOException
Put a single byte onto the stream. 4 bytes will be output.

Throws:
java.io.IOException

writeByte

public void writeByte(int i)
               throws java.io.IOException
Put a single byte onto the stream. 4 bytes will be output. For DataOutput.

Specified by:
writeByte in interface java.io.DataOutput
Throws:
java.io.IOException

writeChar

public void writeChar(char i)
               throws java.io.IOException
Put a char onto the stream. 4 bytes will be output.

Throws:
java.io.IOException

writeChar

public void writeChar(int i)
               throws java.io.IOException
Put a char onto the stream. 4 bytes will be output. For DataOutput.

Specified by:
writeChar in interface java.io.DataOutput
Throws:
java.io.IOException

writeShort

public void writeShort(short i)
                throws java.io.IOException
Put a short onto the stream. 4 bytes will be output.

Throws:
java.io.IOException

writeShort

public void writeShort(int i)
                throws java.io.IOException
Put a short onto the stream. 4 bytes will be output. For DataOutput.

Specified by:
writeShort in interface java.io.DataOutput
Throws:
java.io.IOException

writeInt

public void writeInt(int i)
              throws java.io.IOException
Put an integer onto the stream. 4 bytes will be output.

Specified by:
writeInt in interface java.io.DataOutput
Throws:
java.io.IOException

writeLong

public void writeLong(long l)
               throws java.io.IOException
Put a long onto the stream. 8 bytes will be consumed.

Specified by:
writeLong in interface java.io.DataOutput
Throws:
java.io.IOException

writeFloat

public void writeFloat(float f)
                throws java.io.IOException
Put a floating point number (as 32 bits) onto the stream. It is written in IEEE 754 floating-point "single format" bit layout. 4 bytes will be output.

Specified by:
writeFloat in interface java.io.DataOutput
Throws:
java.io.IOException

writeDouble

public void writeDouble(double d)
                 throws java.io.IOException
Put a double precision floating point number (as 64 bits) onto the stream. It is written in the IEEE 754 floating-point "double format" bit layout. 8 bytes will be output.

Specified by:
writeDouble in interface java.io.DataOutput
Parameters:
d - The double precision floating point number to add to the stream
Throws:
java.io.IOException

writeString

public void writeString(java.lang.String str)
                 throws java.io.IOException
Put a String represented as a variable length opaque data item. The number of bytes consumed will be 4 (for the length), plus the number of bytes in the String, with padding rounded up to the next multiple of 4.

Throws:
java.io.IOException

writeUTF

public void writeUTF(java.lang.String str)
              throws java.io.IOException
Put a String represented as a variable length opaque data item. The number of bytes consumed will be 4 (for the length), plus the number of bytes in the String, with padding rounded up to the next multiple of 4. For DataOutput.

Specified by:
writeUTF in interface java.io.DataOutput
Throws:
java.io.IOException

writeChars

public void writeChars(java.lang.String str)
                throws java.io.IOException
Put a String represented as a variable length opaque data item. The number of bytes consumed will be 4 (for the length), plus the number of bytes in the String, with padding rounded up to the next multiple of 4. For DataOutput.

Specified by:
writeChars in interface java.io.DataOutput
Throws:
java.io.IOException

writeBytes

public void writeBytes(java.lang.String str)
                throws java.io.IOException
Put a String represented as a variable length opaque data item. The number of bytes consumed will be 4 (for the length), plus the number of bytes in the String, with padding rounded up to the next multiple of 4. For DataOutput.

Specified by:
writeBytes in interface java.io.DataOutput
Throws:
java.io.IOException

writeBytes

public void writeBytes(byte[] data)
                throws java.io.IOException
Put a array of bytes onto the stream as a variable length opaque data item. The number of bytes consumed will be 4 (for the length), plus the number of bytes in the String, with padding rounded up to the next multiple of 4.

Throws:
java.io.IOException

writeBytes

public void writeBytes(byte[] data,
                       int bufferOffset,
                       int len)
                throws java.io.IOException
Put a array of bytes onto the stream as a variable length opaque data item. The number of bytes consumed will be 4 (for the length), plus the number of bytes in the String, with padding rounded up to the next multiple of 4.

Parameters:
data - The array which the data is taken from
bufferOffset - The position in the array where copying starts
len - The number of bytes to copy to the buffer
Throws:
java.io.IOException

writeBytes

public void writeBytes(byte[] data,
                       int len)
                throws java.io.IOException
Put a array of bytes onto the stream as a variable length opaque data item. The number of bytes consumed will be 4 (for the length), plus the number of bytes in the String, with padding rounded up to the next multiple of 4.

Parameters:
data - The array which the data is taken from
len - The number of bytes to put onto the stream
Throws:
java.io.IOException

writeFixed

public void writeFixed(byte[] data)
                throws java.io.IOException
Put a array of bytes onto the stream as a fixed length opaque data item. The number of bytes consumed will be the number of bytes in the array, with padding rounded up to the next multiple of 4.

Throws:
java.io.IOException

writeFixed

public void writeFixed(byte[] data,
                       int bufferOffset,
                       int len)
                throws java.io.IOException
Put a array of bytes onto the stream as a fixed length opaque data item. The number of bytes consumed will be the number of bytes in the array, with padding rounded up to the next multiple of 4.

Parameters:
data - The array which the data is taken from
bufferOffset - The position in the array where copying starts
len - The number of bytes to copy to the buffer
Throws:
java.io.IOException

writeFixed

public void writeFixed(byte[] data,
                       int len)
                throws java.io.IOException
Put a array of bytes onto the stream as a fixed length opaque data item. The number of bytes consumed will be the number of bytes in the array, with padding rounded up to the next multiple of 4.

Parameters:
data - The array which the data is taken from
len - The number of bytes to put onto the stream
Throws:
java.io.IOException

toString

public java.lang.String toString()
To string.

Overrides:
toString in class java.lang.Object


RESERVOIR Monitoring 0.6.4