SMILA (incubation) API documentation

org.eclipse.smila.ipc.bon
Class BinaryStreamReader

java.lang.Object
  extended by org.eclipse.smila.ipc.bon.BinaryStreamReader
All Implemented Interfaces:
IpcStreamReader

public class BinaryStreamReader
extends java.lang.Object
implements IpcStreamReader

IPC reader implementation for the binary protocol (BON).

Author:
aweber

Method Summary
 void close()
          Closes the reader and the underlying stream.
 void closeWithoutStream()
          Closes the reader but NOT the underlying stream.
 boolean currentBoolValue()
          Returns the current token value as boolean value.
 double currentDoubleValue()
          Returns the current token value as double value.
 long currentLongValue()
          Returns the current token value as long value.
 java.lang.String currentStringValue()
          Returns the current token value as string.
 java.io.InputStream getStream()
          throws UnsupportedOperationException if not implemented by this response implementation.
 boolean nextBoolValue()
          Shortcut for nextToken() + currentBoolValue().
 double nextDoubleValue()
          Shortcut for nextToken() + currentDoubleValue().
 long nextLongValue()
          Shortcut for nextToken() + currentLongValue().
 java.lang.String nextStringValue()
          Shortcut for nextToken() + currentStringValue().
 IpcToken nextToken()
          Returns the next token.
 
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 reader and the underlying stream.

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

closeWithoutStream

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

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

currentBoolValue

public boolean currentBoolValue()
Returns the current token value as boolean value.

Specified by:
currentBoolValue in interface IpcStreamReader
Returns:
current token value as boolean

currentDoubleValue

public double currentDoubleValue()
Returns the current token value as double value.

Specified by:
currentDoubleValue in interface IpcStreamReader
Returns:
current token value as double

currentLongValue

public long currentLongValue()
Returns the current token value as long value.

Specified by:
currentLongValue in interface IpcStreamReader
Returns:
current token value as long value

currentStringValue

public java.lang.String currentStringValue()
Returns the current token value as string.

Specified by:
currentStringValue in interface IpcStreamReader
Returns:
current token value as string

nextBoolValue

public boolean nextBoolValue()
                      throws java.io.IOException
Shortcut for nextToken() + currentBoolValue().

Specified by:
nextBoolValue in interface IpcStreamReader
Returns:
next token value as boolean.
Throws:
java.io.IOException - any error.

nextDoubleValue

public double nextDoubleValue()
                       throws java.io.IOException
Shortcut for nextToken() + currentDoubleValue().

Specified by:
nextDoubleValue in interface IpcStreamReader
Returns:
next token value as double
Throws:
java.io.IOException - any error

nextLongValue

public long nextLongValue()
                   throws java.io.IOException
Shortcut for nextToken() + currentLongValue().

Specified by:
nextLongValue in interface IpcStreamReader
Returns:
next token value as long
Throws:
java.io.IOException - any error

nextStringValue

public java.lang.String nextStringValue()
                                 throws java.io.IOException
Shortcut for nextToken() + currentStringValue().

Specified by:
nextStringValue in interface IpcStreamReader
Returns:
next token value as string
Throws:
java.io.IOException - any error

nextToken

public IpcToken nextToken()
                   throws java.io.IOException
Returns the next token.

Specified by:
nextToken in interface IpcStreamReader
Returns:
next token
Throws:
java.io.IOException - any error

getStream

public java.io.InputStream getStream()
throws UnsupportedOperationException if not implemented by this response implementation.

Specified by:
getStream in interface IpcStreamReader
Returns:
the internal stream.

SMILA (incubation) API documentation