org.simantics.databoard.util.binary
Interface BinaryWriteable

All Known Subinterfaces:
RandomAccessBinary
All Known Implementing Classes:
BinaryFile, BinaryMemory, Blob, ByteBufferWriteable, FileWriteable, OutputStreamWriteable

public interface BinaryWriteable

Writeable context Common interface for ByteBuffer, byte[], OutputStream, RandomAccessFile.

Author:
Toni Kalajainen (toni.kalajainen@vtt.fi)
See Also:
ByteBufferWriteable, FileWriteable, OutputStreamWriteable

Method Summary
 void flush()
          Flush write buffer
 java.nio.ByteOrder order()
           
 void order(java.nio.ByteOrder order)
           
 void put(byte b)
          Write a byte
 void put(byte[] src)
           
 void put(byte[] src, int offset, int length)
           
 void put(java.nio.ByteBuffer src)
          Put n bytes from the remaining of the byte array.
 void put(java.nio.ByteBuffer src, int length)
          Put n bytes from the remaining of the byte buffer.
 void putDouble(double value)
           
 void putFloat(float value)
           
 void putInt(int value)
           
 void putLong(long value)
           
 void putShort(short value)
           
 

Method Detail

put

void put(byte b)
         throws java.io.IOException,
                java.lang.IndexOutOfBoundsException
Write a byte

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

put

void put(java.nio.ByteBuffer src)
         throws java.io.IOException,
                java.lang.IndexOutOfBoundsException
Put n bytes from the remaining of the byte array. This operation moves the pointer in byte buffer.

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

put

void put(java.nio.ByteBuffer src,
         int length)
         throws java.io.IOException,
                java.lang.IndexOutOfBoundsException
Put n bytes from the remaining of the byte buffer. This operation moves the pointer in byte buffer.

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

put

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

put

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

putShort

void putShort(short value)
              throws java.io.IOException,
                     java.lang.IndexOutOfBoundsException
Throws:
java.io.IOException
java.lang.IndexOutOfBoundsException

putInt

void putInt(int value)
            throws java.io.IOException,
                   java.lang.IndexOutOfBoundsException
Throws:
java.io.IOException
java.lang.IndexOutOfBoundsException

putLong

void putLong(long value)
             throws java.io.IOException,
                    java.lang.IndexOutOfBoundsException
Throws:
java.io.IOException
java.lang.IndexOutOfBoundsException

putFloat

void putFloat(float value)
              throws java.io.IOException,
                     java.lang.IndexOutOfBoundsException
Throws:
java.io.IOException
java.lang.IndexOutOfBoundsException

putDouble

void putDouble(double value)
               throws java.io.IOException,
                      java.lang.IndexOutOfBoundsException
Throws:
java.io.IOException
java.lang.IndexOutOfBoundsException

order

java.nio.ByteOrder order()

order

void order(java.nio.ByteOrder order)

flush

void flush()
           throws java.io.IOException
Flush write buffer

Throws:
java.io.IOException