org.simantics.databoard.util.binary
Interface BinaryReadable

All Superinterfaces:
java.io.DataInput
All Known Subinterfaces:
RandomAccessBinary
All Known Implementing Classes:
BinaryFile, BinaryMemory, Blob, ByteBufferReadable, InputStreamReadable

public interface BinaryReadable
extends java.io.DataInput

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

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

Method Summary
 long length()
           
 long position()
           
 void readFully(java.nio.ByteBuffer buf)
          Read buf fully
 void readFully(java.nio.ByteBuffer buf, int length)
          Read fully length bytes
 long skipBytes(long bytes)
           
 
Methods inherited from interface java.io.DataInput
readBoolean, readByte, readChar, readDouble, readFloat, readFully, readFully, readInt, readLine, readLong, readShort, readUnsignedByte, readUnsignedShort, readUTF, skipBytes
 

Method Detail

skipBytes

long skipBytes(long bytes)
               throws java.io.IOException
Throws:
java.io.IOException

readFully

void readFully(java.nio.ByteBuffer buf)
               throws java.io.IOException
Read buf fully

Parameters:
buf -
Throws:
java.io.IOException

readFully

void readFully(java.nio.ByteBuffer buf,
               int length)
               throws java.io.IOException
Read fully length bytes

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

length

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

position

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