org.simantics.databoard.util.binary
Class InputStreamReadable

java.lang.Object
  extended by org.simantics.databoard.util.binary.InputStreamReadable
All Implemented Interfaces:
BinaryReadable

public class InputStreamReadable
extends java.lang.Object
implements BinaryReadable

Input stream reader

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

Constructor Summary
InputStreamReadable(java.io.InputStream is, long limit)
           
 
Method Summary
 byte get()
           
 void get(byte[] dst)
           
 void get(byte[] dst, int offset, int length)
           
 void get(java.nio.ByteBuffer buf)
          Get buf fully
 void get(java.nio.ByteBuffer buf, int length)
          Get fully length bytes
 double getDouble()
           
 float getFloat()
           
 int getInt()
           
 long getLong()
           
 short getShort()
           
 long length()
           
 java.nio.ByteOrder order()
           
 void order(java.nio.ByteOrder order)
           
 long position()
           
static BinaryReadable readFully(java.io.InputStream is)
           
 void skip(long bytes)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InputStreamReadable

public InputStreamReadable(java.io.InputStream is,
                           long limit)
Method Detail

readFully

public static BinaryReadable readFully(java.io.InputStream is)
                                throws java.io.IOException
Throws:
java.io.IOException

get

public byte get()
         throws java.io.IOException
Specified by:
get in interface BinaryReadable
Throws:
java.io.IOException

get

public void get(byte[] dst,
                int offset,
                int length)
         throws java.io.IOException
Specified by:
get in interface BinaryReadable
Throws:
java.io.IOException

get

public void get(byte[] dst)
         throws java.io.IOException
Specified by:
get in interface BinaryReadable
Throws:
java.io.IOException

get

public void get(java.nio.ByteBuffer buf)
         throws java.io.IOException
Description copied from interface: BinaryReadable
Get buf fully

Specified by:
get in interface BinaryReadable
Throws:
java.io.IOException

get

public void get(java.nio.ByteBuffer buf,
                int length)
         throws java.io.IOException
Description copied from interface: BinaryReadable
Get fully length bytes

Specified by:
get in interface BinaryReadable
Throws:
java.io.IOException

getDouble

public double getDouble()
                 throws java.io.IOException
Specified by:
getDouble in interface BinaryReadable
Throws:
java.io.IOException

getFloat

public float getFloat()
               throws java.io.IOException
Specified by:
getFloat in interface BinaryReadable
Throws:
java.io.IOException

getInt

public int getInt()
           throws java.io.IOException
Specified by:
getInt in interface BinaryReadable
Throws:
java.io.IOException

getLong

public long getLong()
             throws java.io.IOException
Specified by:
getLong in interface BinaryReadable
Throws:
java.io.IOException

getShort

public short getShort()
               throws java.io.IOException
Specified by:
getShort in interface BinaryReadable
Throws:
java.io.IOException

length

public long length()
Specified by:
length in interface BinaryReadable

position

public long position()
Specified by:
position in interface BinaryReadable

order

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

order

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

skip

public void skip(long bytes)
          throws java.io.IOException
Specified by:
skip in interface BinaryReadable
Throws:
java.io.IOException