org.opcfoundation.ua.utils.bytebuffer
Class InputStreamReadable

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

public class InputStreamReadable
extends Object
implements IBinaryReadable

Input stream reader

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

Constructor Summary
InputStreamReadable(InputStream is, long limit)
          Constructor for InputStreamReadable.
 
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 skip(long bytes)
          skip.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InputStreamReadable

public InputStreamReadable(InputStream is,
                           long limit)

Constructor for InputStreamReadable.

Parameters:
is - a InputStream object.
limit - a long.
Method Detail

get

public byte get()
         throws IOException

get.

Specified by:
get in interface IBinaryReadable
Returns:
a byte.
Throws:
IOException - if any.

get

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

get.

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

get

public void get(byte[] dst)
         throws IOException

get.

Specified by:
get in interface IBinaryReadable
Parameters:
dst - an array of byte.
Throws:
IOException - if any.

get

public void get(ByteBuffer buf)
         throws IOException
Get buf fully

Specified by:
get in interface IBinaryReadable
Parameters:
buf - a ByteBuffer object.
Throws:
IOException - if any.

get

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

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

getDouble

public double getDouble()
                 throws IOException

getDouble.

Specified by:
getDouble in interface IBinaryReadable
Returns:
a double.
Throws:
IOException - if any.

getFloat

public float getFloat()
               throws IOException

getFloat.

Specified by:
getFloat in interface IBinaryReadable
Returns:
a float.
Throws:
IOException - if any.

getInt

public int getInt()
           throws IOException

getInt.

Specified by:
getInt in interface IBinaryReadable
Returns:
a int.
Throws:
IOException - if any.

getLong

public long getLong()
             throws IOException

getLong.

Specified by:
getLong in interface IBinaryReadable
Returns:
a long.
Throws:
IOException - if any.

getShort

public short getShort()
               throws IOException

getShort.

Specified by:
getShort in interface IBinaryReadable
Returns:
a short.
Throws:
IOException - if any.

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.

skip

public void skip(long bytes)
          throws IOException

skip.

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


Copyright © 2018. All rights reserved.