org.simantics.databoard.util.binary
Class OutputStreamWriteable

java.lang.Object
  extended by org.simantics.databoard.util.binary.OutputStreamWriteable
All Implemented Interfaces:
java.io.DataOutput, BinaryWriteable

public class OutputStreamWriteable
extends java.lang.Object
implements BinaryWriteable


Constructor Summary
OutputStreamWriteable(java.io.OutputStream out)
           
 
Method Summary
 void flush()
          Flush write buffer
 java.io.OutputStream getStream()
           
 java.nio.ByteOrder order()
           
 void order(java.nio.ByteOrder order)
           
 void write(byte[] src)
           
 void write(byte[] src, int offset, int length)
           
 void write(int b)
           
 void writeBoolean(boolean v)
           
 void writeByte(int b)
           
 void writeBytes(java.lang.String s)
           
 void writeChar(int value)
           
 void writeChars(java.lang.String s)
           
 void writeDouble(double value)
           
 void writeFloat(float value)
           
 void writeFully(java.nio.ByteBuffer src)
          Put n bytes from the remaining of the byte array.
 void writeFully(java.nio.ByteBuffer src, int length)
          Put n bytes from the remaining of the byte buffer.
 void writeInt(int value)
           
 void writeLong(long value)
           
 void writeShort(int value)
           
 void writeUTF(java.lang.String s)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OutputStreamWriteable

public OutputStreamWriteable(java.io.OutputStream out)
Method Detail

getStream

public java.io.OutputStream getStream()

write

public void write(int b)
           throws java.io.IOException
Specified by:
write in interface java.io.DataOutput
Throws:
java.io.IOException

writeByte

public void writeByte(int b)
               throws java.io.IOException
Specified by:
writeByte in interface java.io.DataOutput
Throws:
java.io.IOException

writeBoolean

public void writeBoolean(boolean v)
                  throws java.io.IOException
Specified by:
writeBoolean in interface java.io.DataOutput
Throws:
java.io.IOException

writeFully

public void writeFully(java.nio.ByteBuffer src)
                throws java.io.IOException
Description copied from interface: BinaryWriteable
Put n bytes from the remaining of the byte array. This operation moves the pointer in byte buffer.

Specified by:
writeFully in interface BinaryWriteable
Throws:
java.io.IOException

writeFully

public void writeFully(java.nio.ByteBuffer src,
                       int length)
                throws java.io.IOException
Description copied from interface: BinaryWriteable
Put n bytes from the remaining of the byte buffer. This operation moves the pointer in byte buffer.

Specified by:
writeFully in interface BinaryWriteable
Throws:
java.io.IOException

write

public void write(byte[] src,
                  int offset,
                  int length)
           throws java.io.IOException
Specified by:
write in interface java.io.DataOutput
Throws:
java.io.IOException

write

public void write(byte[] src)
           throws java.io.IOException
Specified by:
write in interface java.io.DataOutput
Throws:
java.io.IOException

writeDouble

public void writeDouble(double value)
                 throws java.io.IOException
Specified by:
writeDouble in interface java.io.DataOutput
Throws:
java.io.IOException

writeFloat

public void writeFloat(float value)
                throws java.io.IOException
Specified by:
writeFloat in interface java.io.DataOutput
Throws:
java.io.IOException

writeInt

public void writeInt(int value)
              throws java.io.IOException
Specified by:
writeInt in interface java.io.DataOutput
Throws:
java.io.IOException

writeLong

public void writeLong(long value)
               throws java.io.IOException
Specified by:
writeLong in interface java.io.DataOutput
Throws:
java.io.IOException

writeShort

public void writeShort(int value)
                throws java.io.IOException
Specified by:
writeShort in interface java.io.DataOutput
Throws:
java.io.IOException

writeChar

public void writeChar(int value)
               throws java.io.IOException
Specified by:
writeChar in interface java.io.DataOutput
Throws:
java.io.IOException

writeBytes

public void writeBytes(java.lang.String s)
                throws java.io.IOException
Specified by:
writeBytes in interface java.io.DataOutput
Throws:
java.io.IOException

writeChars

public void writeChars(java.lang.String s)
                throws java.io.IOException
Specified by:
writeChars in interface java.io.DataOutput
Throws:
java.io.IOException

writeUTF

public void writeUTF(java.lang.String s)
              throws java.io.IOException
Specified by:
writeUTF in interface java.io.DataOutput
Throws:
java.io.IOException

order

public java.nio.ByteOrder order()

order

public void order(java.nio.ByteOrder order)

flush

public void flush()
           throws java.io.IOException
Description copied from interface: BinaryWriteable
Flush write buffer

Specified by:
flush in interface BinaryWriteable
Throws:
java.io.IOException