SMILA 1.0 API documentation

org.eclipse.smila.ipc.bon
Class BinaryStreamWriter

java.lang.Object
  extended by org.eclipse.smila.ipc.bon.BinaryStreamWriter
All Implemented Interfaces:
IpcStreamWriter

public class BinaryStreamWriter
extends java.lang.Object
implements IpcStreamWriter

IPC writer implementation for the binary protocol (BON).

Author:
aweber

Method Summary
 void close()
          Closes the writer and the underlying stream.
 void closeWithoutStream()
          Closes the writer but NOT the underlying stream.
 boolean hasBinarySupport()
           
 void writeAttachmentsEnd()
          Writes marker signaling end of a attachments list.
 void writeAttachmentsStart()
          Writes marker signaling start of attachments list.
 void writeBinary(byte[] b)
          Writes binary value.
 void writeMappingEnd()
          Writes marker signaling end of a mapping.
 void writeMappingKey(java.lang.String s)
          Writes a mapping key.
 void writeMappingStart()
          Writes marker signaling start of a mapping.
 void writeObjectEnd()
          Writes marker signaling end of an object (resp.
 void writeObjectStart()
          Writes marker signaling start of an object (resp.
 void writeScalarBoolean(boolean b)
          Writes boolean value.
 void writeScalarDouble(double d)
          Writes double value.
 void writeScalarInt(int i)
          Writes integer value.
 void writeScalarLong(long i)
          Writes long value.
 void writeScalarString(java.lang.String s)
          Writes string value.
 void writeSequenceEnd()
          Writes marker signaling end of a sequence.
 void writeSequenceStart()
          Writes marker signaling start of a sequence.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

close

public void close()
           throws java.io.IOException
Closes the writer and the underlying stream.

Specified by:
close in interface IpcStreamWriter
Throws:
java.io.IOException - any error

closeWithoutStream

public void closeWithoutStream()
                        throws java.io.IOException
Closes the writer but NOT the underlying stream.

Specified by:
closeWithoutStream in interface IpcStreamWriter
Throws:
java.io.IOException - any error

writeObjectEnd

public void writeObjectEnd()
                    throws java.io.IOException
Writes marker signaling end of an object (resp. a document). Will be ignored if underlying implementation doesn't support this kind of marker.

Specified by:
writeObjectEnd in interface IpcStreamWriter
Throws:
java.io.IOException - any error

writeObjectStart

public void writeObjectStart()
                      throws java.io.IOException
Writes marker signaling start of an object (resp. a document). Will be ignored if underlying implementation doesn't support this kind of marker.

Specified by:
writeObjectStart in interface IpcStreamWriter
Throws:
java.io.IOException - any error

writeMappingEnd

public void writeMappingEnd()
                     throws java.io.IOException
Writes marker signaling end of a mapping.

Specified by:
writeMappingEnd in interface IpcStreamWriter
Throws:
java.io.IOException - any error

writeMappingStart

public void writeMappingStart()
                       throws java.io.IOException
Writes marker signaling start of a mapping.

Specified by:
writeMappingStart in interface IpcStreamWriter
Throws:
java.io.IOException - any error

writeScalarBoolean

public void writeScalarBoolean(boolean b)
                        throws java.io.IOException
Writes boolean value. any error

Specified by:
writeScalarBoolean in interface IpcStreamWriter
Parameters:
b - value to write
Throws:
java.io.IOException - any error

writeScalarDouble

public void writeScalarDouble(double d)
                       throws java.io.IOException
Writes double value.

Specified by:
writeScalarDouble in interface IpcStreamWriter
Parameters:
d - value to write
Throws:
java.io.IOException - any error

writeScalarInt

public void writeScalarInt(int i)
                    throws java.io.IOException
Writes integer value.

Specified by:
writeScalarInt in interface IpcStreamWriter
Parameters:
i - value to write
Throws:
java.io.IOException - any error

writeScalarLong

public void writeScalarLong(long i)
                     throws java.io.IOException
Writes long value.

Specified by:
writeScalarLong in interface IpcStreamWriter
Parameters:
i - value to write
Throws:
java.io.IOException - any error

writeScalarString

public void writeScalarString(java.lang.String s)
                       throws java.io.IOException
Writes string value.

Specified by:
writeScalarString in interface IpcStreamWriter
Parameters:
s - value to write
Throws:
java.io.IOException - any error

writeBinary

public void writeBinary(byte[] b)
                 throws java.io.IOException
Writes binary value.

Specified by:
writeBinary in interface IpcStreamWriter
Throws:
java.io.IOException - any error

writeSequenceEnd

public void writeSequenceEnd()
                      throws java.io.IOException
Writes marker signaling end of a sequence.

Specified by:
writeSequenceEnd in interface IpcStreamWriter
Throws:
java.io.IOException - any error

writeSequenceStart

public void writeSequenceStart()
                        throws java.io.IOException
Writes marker signaling start of a sequence.

Specified by:
writeSequenceStart in interface IpcStreamWriter
Throws:
java.io.IOException - any error

writeMappingKey

public void writeMappingKey(java.lang.String s)
                     throws java.io.IOException
Writes a mapping key. Depending on the underlying implementation there may be no difference to just writing a scalar string. But e.g. in JSON keys are completed by an additional ":".

Specified by:
writeMappingKey in interface IpcStreamWriter
Parameters:
s - value to write
Throws:
java.io.IOException - any error

writeAttachmentsStart

public void writeAttachmentsStart()
                           throws java.io.IOException
Writes marker signaling start of attachments list.

Specified by:
writeAttachmentsStart in interface IpcStreamWriter
Throws:
java.io.IOException - any error

writeAttachmentsEnd

public void writeAttachmentsEnd()
                         throws java.io.IOException
Writes marker signaling end of a attachments list.

Specified by:
writeAttachmentsEnd in interface IpcStreamWriter
Throws:
java.io.IOException - any error

hasBinarySupport

public boolean hasBinarySupport()
Specified by:
hasBinarySupport in interface IpcStreamWriter
Returns:
'true' if binaries are supported, otherwise 'false'.

SMILA 1.0 API documentation