thinkmap.datasource.stream
Class BinaryStreamFormat

java.lang.Object
  extended by thinkmap.datasource.stream.BinaryStreamFormat
All Implemented Interfaces:
IStreamFormat

public class BinaryStreamFormat
extends Object
implements IStreamFormat

This class implements the default stream format for the Thinkmap RemoteDataSource. It is a compact binary format that does not use serialization and is only capable of sending primative objects over the wire. The objects it supports are String, any instance of Number, Character, Boolean, and Date.

It also houses a number of constants that are used by both the BinaryStreamWriter and the BinaryStreamReader

Version:
$Revision: 1.3 $

Field Summary
static byte ATTRIBUTE
           
static byte BEGIN_ENTITY
           
static byte BEGIN_ENTITY_MD
           
static byte BEGIN_ID
           
static byte BEGIN_MESSAGE
           
static byte BEGIN_RELATED_ENTITY
           
static byte BEGIN_RELATED_LIST
           
static byte END_ENTITY
           
static byte END_ENTITY_MD
           
static byte END_ID
           
static byte END_MESSAGE
           
static byte END_RELATED_ENTITY
           
static byte END_RELATED_LIST
           
static byte ERROR
           
static byte FATAL_ERROR
           
static byte ID_KEY
           
static byte ID_KEY_MD
           
static byte MAJOR_VERSION
           
static String MIME_TYPE
           
static byte MINOR_VERSION
           
static byte OBJ_ARRAY
           
static byte OBJ_BOOLEAN
           
static byte OBJ_BYTE
           
static byte OBJ_CHAR
           
static byte OBJ_CLASS
           
static byte OBJ_DATE
           
static byte OBJ_DOUBLE
           
static byte OBJ_FLOAT
           
static byte OBJ_INTEGER
           
static byte OBJ_LONG
           
static byte OBJ_NULL
           
static byte OBJ_SHORT
           
static byte OBJ_STRING
           
static byte OBJ_UNKNOWN
           
static byte PROPERTY
           
static byte PROPERTY_MD
           
protected  IStreamReader reader
           
static String TM_IDENTIFIER
           
 
Constructor Summary
BinaryStreamFormat()
           
 
Method Summary
 String getMimeType()
          Get the mime-type of this stream format: "application/x-thinkmap-2.0"
 IStreamReader getStreamReader(IStreamFactory factory)
          Produce a new StreamReader for this StreamFactory.
 StreamWriter getStreamWriter(IStreamFactory factory)
          Produce a new StreamWriter for this StreamFactory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MIME_TYPE

public static final String MIME_TYPE
See Also:
Constant Field Values

BEGIN_MESSAGE

public static final byte BEGIN_MESSAGE
See Also:
Constant Field Values

ATTRIBUTE

public static final byte ATTRIBUTE
See Also:
Constant Field Values

BEGIN_ENTITY

public static final byte BEGIN_ENTITY
See Also:
Constant Field Values

END_ENTITY

public static final byte END_ENTITY
See Also:
Constant Field Values

BEGIN_ENTITY_MD

public static final byte BEGIN_ENTITY_MD
See Also:
Constant Field Values

END_ENTITY_MD

public static final byte END_ENTITY_MD
See Also:
Constant Field Values

PROPERTY

public static final byte PROPERTY
See Also:
Constant Field Values

PROPERTY_MD

public static final byte PROPERTY_MD
See Also:
Constant Field Values

BEGIN_ID

public static final byte BEGIN_ID
See Also:
Constant Field Values

ID_KEY

public static final byte ID_KEY
See Also:
Constant Field Values

ID_KEY_MD

public static final byte ID_KEY_MD
See Also:
Constant Field Values

END_ID

public static final byte END_ID
See Also:
Constant Field Values

BEGIN_RELATED_LIST

public static final byte BEGIN_RELATED_LIST
See Also:
Constant Field Values

END_RELATED_LIST

public static final byte END_RELATED_LIST
See Also:
Constant Field Values

BEGIN_RELATED_ENTITY

public static final byte BEGIN_RELATED_ENTITY
See Also:
Constant Field Values

END_RELATED_ENTITY

public static final byte END_RELATED_ENTITY
See Also:
Constant Field Values

END_MESSAGE

public static final byte END_MESSAGE
See Also:
Constant Field Values

ERROR

public static final byte ERROR
See Also:
Constant Field Values

FATAL_ERROR

public static final byte FATAL_ERROR
See Also:
Constant Field Values

OBJ_ARRAY

public static final byte OBJ_ARRAY
See Also:
Constant Field Values

OBJ_UNKNOWN

public static final byte OBJ_UNKNOWN
See Also:
Constant Field Values

OBJ_NULL

public static final byte OBJ_NULL
See Also:
Constant Field Values

OBJ_DATE

public static final byte OBJ_DATE
See Also:
Constant Field Values

OBJ_STRING

public static final byte OBJ_STRING
See Also:
Constant Field Values

OBJ_BOOLEAN

public static final byte OBJ_BOOLEAN
See Also:
Constant Field Values

OBJ_BYTE

public static final byte OBJ_BYTE
See Also:
Constant Field Values

OBJ_CHAR

public static final byte OBJ_CHAR
See Also:
Constant Field Values

OBJ_DOUBLE

public static final byte OBJ_DOUBLE
See Also:
Constant Field Values

OBJ_FLOAT

public static final byte OBJ_FLOAT
See Also:
Constant Field Values

OBJ_INTEGER

public static final byte OBJ_INTEGER
See Also:
Constant Field Values

OBJ_LONG

public static final byte OBJ_LONG
See Also:
Constant Field Values

OBJ_SHORT

public static final byte OBJ_SHORT
See Also:
Constant Field Values

OBJ_CLASS

public static final byte OBJ_CLASS
See Also:
Constant Field Values

MAJOR_VERSION

public static final byte MAJOR_VERSION
See Also:
Constant Field Values

MINOR_VERSION

public static final byte MINOR_VERSION
See Also:
Constant Field Values

TM_IDENTIFIER

public static final String TM_IDENTIFIER
See Also:
Constant Field Values

reader

protected IStreamReader reader
Constructor Detail

BinaryStreamFormat

public BinaryStreamFormat()
Method Detail

getStreamWriter

public StreamWriter getStreamWriter(IStreamFactory factory)
Description copied from interface: IStreamFormat
Produce a new StreamWriter for this StreamFactory. The StreamFactory is usually passed to the constructor of the StreamWriter, so that it can aquire a stream to write to.

Specified by:
getStreamWriter in interface IStreamFormat
Parameters:
factory - the factory that is producing the stream.
Returns:
stream writer

getStreamReader

public IStreamReader getStreamReader(IStreamFactory factory)
Description copied from interface: IStreamFormat
Produce a new StreamReader for this StreamFactory.

Specified by:
getStreamReader in interface IStreamFormat
Parameters:
factory - the factory that is producing the stream.
Returns:
stream reader

getMimeType

public String getMimeType()
Get the mime-type of this stream format: "application/x-thinkmap-2.0"

Specified by:
getMimeType in interface IStreamFormat
Returns:
"application/x-thinkmap-2.0"


Copyright © 2013 Thinkmap, Inc. All Rights Reserved.