org.simantics.databoard.util.binary
Class OutputStreamWriteable

java.lang.Object
  extended by org.simantics.databoard.util.binary.OutputStreamWriteable
All Implemented Interfaces:
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 put(byte b)
          Write a byte
 void put(byte[] src)
           
 void put(byte[] src, int offset, int length)
           
 void put(java.nio.ByteBuffer src)
          Put n bytes from the remaining of the byte array.
 void put(java.nio.ByteBuffer src, int length)
          Put n bytes from the remaining of the byte buffer.
 void putDouble(double value)
           
 void putFloat(float value)
           
 void putInt(int value)
           
 void putLong(long value)
           
 void putShort(short value)
           
 
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()

put

public void put(byte b)
         throws java.io.IOException
Description copied from interface: BinaryWriteable
Write a byte

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

put

public void put(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:
put in interface BinaryWriteable
Throws:
java.io.IOException

put

public void put(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:
put in interface BinaryWriteable
Throws:
java.io.IOException

put

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

put

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

putDouble

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

putFloat

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

putInt

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

putLong

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

putShort

public void putShort(short value)
              throws java.io.IOException
Specified by:
putShort in interface BinaryWriteable
Throws:
java.io.IOException

order

public java.nio.ByteOrder order()
Specified by:
order in interface BinaryWriteable

order

public void order(java.nio.ByteOrder order)
Specified by:
order in interface BinaryWriteable

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