org.simantics.databoard.util.binary
Interface BinaryReadable

All Known Subinterfaces:
RandomAccessBinary
All Known Implementing Classes:
BinaryFile, BinaryMemory, Blob, ByteBufferReadable, FileReadable, InputStreamReadable

public interface BinaryReadable

BinaryReadable is a readable stream of bytes. Common interface for ByteBuffer, byte[], InputStream, RandomAccessFile.

Author:
Toni Kalajainen (toni.kalajainen@vtt.fi)
See Also:
ByteBufferReadable, FileReadable, InputStreamReadable

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()
           
 void skip(long bytes)
           
 

Method Detail

get

byte get()
         throws java.io.IOException,
                java.lang.IndexOutOfBoundsException
Throws:
java.io.IOException
java.lang.IndexOutOfBoundsException

get

void get(byte[] dst,
         int offset,
         int length)
         throws java.io.IOException,
                java.lang.IndexOutOfBoundsException
Throws:
java.io.IOException
java.lang.IndexOutOfBoundsException

get

void get(byte[] dst)
         throws java.io.IOException,
                java.lang.IndexOutOfBoundsException
Throws:
java.io.IOException
java.lang.IndexOutOfBoundsException

get

void get(java.nio.ByteBuffer buf)
         throws java.io.IOException,
                java.lang.IndexOutOfBoundsException
Get buf fully

Parameters:
buf -
Throws:
java.io.IOException
java.lang.IndexOutOfBoundsException

get

void get(java.nio.ByteBuffer buf,
         int length)
         throws java.io.IOException,
                java.lang.IndexOutOfBoundsException
Get fully length bytes

Parameters:
buf -
length -
Throws:
java.io.IOException
java.lang.IndexOutOfBoundsException

getShort

short getShort()
               throws java.io.IOException,
                      java.lang.IndexOutOfBoundsException
Throws:
java.io.IOException
java.lang.IndexOutOfBoundsException

getInt

int getInt()
           throws java.io.IOException,
                  java.lang.IndexOutOfBoundsException
Throws:
java.io.IOException
java.lang.IndexOutOfBoundsException

getLong

long getLong()
             throws java.io.IOException,
                    java.lang.IndexOutOfBoundsException
Throws:
java.io.IOException
java.lang.IndexOutOfBoundsException

getFloat

float getFloat()
               throws java.io.IOException,
                      java.lang.IndexOutOfBoundsException
Throws:
java.io.IOException
java.lang.IndexOutOfBoundsException

getDouble

double getDouble()
                 throws java.io.IOException,
                        java.lang.IndexOutOfBoundsException
Throws:
java.io.IOException
java.lang.IndexOutOfBoundsException

length

long length()
            throws java.io.IOException
Throws:
java.io.IOException

order

java.nio.ByteOrder order()

order

void order(java.nio.ByteOrder order)

position

long position()
              throws java.io.IOException
Throws:
java.io.IOException

skip

void skip(long bytes)
          throws java.io.IOException
Throws:
java.io.IOException