messif.objects.nio
Interface BinaryOutput

All Known Implementing Classes:
BufferOutputStream, FileChannelOutputStream, ChannelOutputStream

public interface BinaryOutput

Interface for classes that can write a binary data. Such data can be provided by a BinarySerializator.


Method Summary
 void flush()
          Flushes this output and forces any buffered output bytes to be written out to the flushChannel.
 java.nio.ByteBuffer prepareOutput(int minBytes)
          Returns a buffer that allows to write at least minBytes.
 

Method Detail

prepareOutput

java.nio.ByteBuffer prepareOutput(int minBytes)
                                  throws java.io.IOException
Returns a buffer that allows to write at least minBytes. If the buffer with the required space cannot be provided, an IOException is thrown. Note that the returned buffer can provide more than minBytes.

Parameters:
minBytes - the minimal number of bytes that must be available for writing into the buffer
Returns:
the buffer prepared for writing
Throws:
java.io.IOException - if there was an error while preparing a buffer for minBytes bytes

flush

void flush()
           throws java.io.IOException
Flushes this output and forces any buffered output bytes to be written out to the flushChannel.

Throws:
java.io.IOException - if there was an error using flushChannel