org.opcfoundation.ua.utils.bytebuffer
Class ByteBufferReadable

java.lang.Object
  extended by org.opcfoundation.ua.utils.bytebuffer.ByteBufferReadable
All Implemented Interfaces:
IBinaryReadable

public class ByteBufferReadable
extends Object
implements IBinaryReadable

ByteBufferReadable class.

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

Constructor Summary
ByteBufferReadable(byte[] buf)
          Constructor for ByteBufferReadable.
ByteBufferReadable(ByteBuffer buf)
          Constructor for ByteBufferReadable.
 
Method Summary
 byte get()
          get.
 void get(byte[] dst)
          get.
 void get(byte[] dst, int offset, int length)
          get.
 void get(ByteBuffer buf)
          Get buf fully
 void get(ByteBuffer buf, int length)
          Get fully length bytes
 double getDouble()
          getDouble.
 float getFloat()
          getFloat.
 int getInt()
          getInt.
 long getLong()
          getLong.
 short getShort()
          getShort.
 long limit()
          limit.
 ByteOrder order()
          order.
 void order(ByteOrder order)
          order.
 long position()
          position.
 void position(int newPosition)
          position.
 void position(long newPosition)
          position.
 void skip(long bytes)
          skip.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ByteBufferReadable

public ByteBufferReadable(ByteBuffer buf)

Constructor for ByteBufferReadable.

Parameters:
buf - a ByteBuffer object.

ByteBufferReadable

public ByteBufferReadable(byte[] buf)

Constructor for ByteBufferReadable.

Parameters:
buf - an array of byte.
Method Detail

get

public byte get()

get.

Specified by:
get in interface IBinaryReadable
Returns:
a byte.

get

public void get(byte[] dst,
                int offset,
                int length)

get.

Specified by:
get in interface IBinaryReadable
Parameters:
dst - an array of byte.
offset - a int.
length - a int.

get

public void get(byte[] dst)

get.

Specified by:
get in interface IBinaryReadable
Parameters:
dst - an array of byte.

get

public void get(ByteBuffer buf)
Get buf fully

Specified by:
get in interface IBinaryReadable
Parameters:
buf - a ByteBuffer object.

get

public void get(ByteBuffer buf,
                int length)
Get fully length bytes

Specified by:
get in interface IBinaryReadable
Parameters:
buf - a ByteBuffer object.
length - a int.

getDouble

public double getDouble()

getDouble.

Specified by:
getDouble in interface IBinaryReadable
Returns:
a double.

getFloat

public float getFloat()

getFloat.

Specified by:
getFloat in interface IBinaryReadable
Returns:
a float.

getInt

public int getInt()

getInt.

Specified by:
getInt in interface IBinaryReadable
Returns:
a int.

getLong

public long getLong()

getLong.

Specified by:
getLong in interface IBinaryReadable
Returns:
a long.

getShort

public short getShort()

getShort.

Specified by:
getShort in interface IBinaryReadable
Returns:
a short.

limit

public long limit()

limit.

Specified by:
limit in interface IBinaryReadable
Returns:
a long.

position

public long position()

position.

Specified by:
position in interface IBinaryReadable
Returns:
a long.

order

public ByteOrder order()

order.

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

order

public void order(ByteOrder order)

order.

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

position

public void position(int newPosition)
              throws IOException

position.

Parameters:
newPosition - a int.
Throws:
IOException - if any.

position

public void position(long newPosition)
              throws IOException

position.

Parameters:
newPosition - a long.
Throws:
IOException - if any.

skip

public void skip(long bytes)
          throws IOException

skip.

Parameters:
bytes - a long.
Throws:
IOException - if any.


Copyright © 2018. All rights reserved.