org.opcfoundation.ua.utils.bytebuffer
Class ByteBufferArrayWriteable2

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

public class ByteBufferArrayWriteable2
extends Object
implements IBinaryWriteable

Sends events when chunks are complete

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

Nested Class Summary
static interface ByteBufferArrayWriteable2.ChunkListener
           
 
Constructor Summary
ByteBufferArrayWriteable2(ByteBuffer[] bufs, ByteBufferArrayWriteable2.ChunkListener listener)
          Constructor for ByteBufferArrayWriteable2.
 
Method Summary
protected  void fireChunkComplete(int index)
          fireChunkComplete.
 void flush()
          flush.
 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

ByteBufferArrayWriteable2

public ByteBufferArrayWriteable2(ByteBuffer[] bufs,
                                 ByteBufferArrayWriteable2.ChunkListener listener)

Constructor for ByteBufferArrayWriteable2.

Parameters:
bufs - an array of ByteBuffer objects.
listener - a ByteBufferArrayWriteable2.ChunkListener object.
Method Detail

fireChunkComplete

protected void fireChunkComplete(int index)

fireChunkComplete.

Parameters:
index - a int.

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.

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.

flush

public void flush()

flush.

Specified by:
flush in interface IBinaryWriteable


Copyright © 2018. All rights reserved.