org.opcfoundation.ua.utils.bytebuffer
Class OutputStreamWriteable

java.lang.Object
  extended by org.opcfoundation.ua.utils.bytebuffer.OutputStreamWriteable
All Implemented Interfaces:
IBinaryWriteable

public class OutputStreamWriteable
extends Object
implements IBinaryWriteable

Output stream writer

Author:
Toni Kalajainen (toni.kalajainen@vtt.fi)

Constructor Summary
OutputStreamWriteable(OutputStream out)
          Constructor for OutputStreamWriteable.
 
Method Summary
 void flush()
          flush.
 OutputStream getStream()
          getStream.
 ByteOrder order()
          order.
 void order(ByteOrder order)
          order.
 void put(byte b)
          put.
 void put(byte[] src)
          put.
 void put(byte[] src, int offset, int length)
          put.
 void put(ByteBuffer src)
          Put n bytes from the remaining of the byte array.
 void put(ByteBuffer src, int length)
          Put n bytes from the remaining of the byte buffer.
 void putDouble(double value)
          putDouble.
 void putFloat(float value)
          putFloat.
 void putInt(int value)
          putInt.
 void putLong(long value)
          putLong.
 void putShort(short value)
          putShort.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OutputStreamWriteable

public OutputStreamWriteable(OutputStream out)

Constructor for OutputStreamWriteable.

Parameters:
out - a OutputStream object.
Method Detail

getStream

public OutputStream getStream()

getStream.

Returns:
a OutputStream object.

put

public void put(byte b)
         throws IOException

put.

Specified by:
put in interface IBinaryWriteable
Parameters:
b - a byte.
Throws:
IOException - if any.

put

public void put(ByteBuffer src)
         throws IOException
Put n bytes from the remaining of the byte array. This operation moves the pointer in byte buffer.

Specified by:
put in interface IBinaryWriteable
Parameters:
src - a ByteBuffer object.
Throws:
IOException - if any.

put

public void put(ByteBuffer src,
                int length)
         throws IOException
Put n bytes from the remaining of the byte buffer. This operation moves the pointer in byte buffer.

Specified by:
put in interface IBinaryWriteable
Parameters:
src - a ByteBuffer object.
length - a int.
Throws:
IOException - if any.

put

public void put(byte[] src,
                int offset,
                int length)
         throws IOException

put.

Specified by:
put in interface IBinaryWriteable
Parameters:
src - an array of byte.
offset - a int.
length - a int.
Throws:
IOException - if any.

put

public void put(byte[] src)
         throws IOException

put.

Specified by:
put in interface IBinaryWriteable
Parameters:
src - an array of byte.
Throws:
IOException - if any.

putDouble

public void putDouble(double value)
               throws IOException

putDouble.

Specified by:
putDouble in interface IBinaryWriteable
Parameters:
value - a double.
Throws:
IOException - if any.

putFloat

public void putFloat(float value)
              throws IOException

putFloat.

Specified by:
putFloat in interface IBinaryWriteable
Parameters:
value - a float.
Throws:
IOException - if any.

putInt

public void putInt(int value)
            throws IOException

putInt.

Specified by:
putInt in interface IBinaryWriteable
Parameters:
value - a int.
Throws:
IOException - if any.

putLong

public void putLong(long value)
             throws IOException

putLong.

Specified by:
putLong in interface IBinaryWriteable
Parameters:
value - a long.
Throws:
IOException - if any.

putShort

public void putShort(short value)
              throws IOException

putShort.

Specified by:
putShort in interface IBinaryWriteable
Parameters:
value - a short.
Throws:
IOException - if any.

order

public ByteOrder order()

order.

Specified by:
order in interface IBinaryWriteable
Returns:
a ByteOrder object.

order

public void order(ByteOrder order)

order.

Specified by:
order in interface IBinaryWriteable
Parameters:
order - a ByteOrder object.

flush

public void flush()
           throws IOException

flush.

Specified by:
flush in interface IBinaryWriteable
Throws:
IOException - if any.


Copyright © 2018. All rights reserved.