public abstract class

Token

extends Object
java.lang.Object
   ↳ com.thoughtworks.xstream.io.binary.Token
Known Direct Subclasses

Class Overview

Represents the Tokens stored in the binary stream used by BinaryStreamReader and BinaryStreamWriter.

A token consists of a type and (depending on this type) it may additionally have an ID (positive long number) and/or a value (String).

The first byte of the token represents how many subsequent bytes are used by the ID.

Summary

Nested Classes
class Token.Attribute  
class Token.EndNode  
class Token.Formatter  
class Token.MapIdToValue  
class Token.StartNode  
class Token.Value  
Constants
byte TYPE_ATTRIBUTE
byte TYPE_END_NODE
byte TYPE_MAP_ID_TO_VALUE
byte TYPE_START_NODE
byte TYPE_VALUE
byte TYPE_VERSION
Fields
protected long id
protected String value
Public Constructors
Token(byte type)
Public Methods
boolean equals(Object o)
long getId()
byte getType()
String getValue()
int hashCode()
abstract void readFrom(DataInput in, byte idType)
String toString()
abstract void writeTo(DataOutput out, byte idType)
Protected Methods
long readId(DataInput in, byte idType)
String readString(DataInput in)
void writeId(DataOutput out, long id, byte idType)
void writeString(DataOutput out, String string)
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final byte TYPE_ATTRIBUTE

Constant Value: 5 (0x00000005)

public static final byte TYPE_END_NODE

Constant Value: 4 (0x00000004)

public static final byte TYPE_MAP_ID_TO_VALUE

Constant Value: 2 (0x00000002)

public static final byte TYPE_START_NODE

Constant Value: 3 (0x00000003)

public static final byte TYPE_VALUE

Constant Value: 6 (0x00000006)

public static final byte TYPE_VERSION

Constant Value: 1 (0x00000001)

Fields

protected long id

protected String value

Public Constructors

public Token (byte type)

Public Methods

public boolean equals (Object o)

public long getId ()

public byte getType ()

public String getValue ()

public int hashCode ()

public abstract void readFrom (DataInput in, byte idType)

Throws
IOException

public String toString ()

public abstract void writeTo (DataOutput out, byte idType)

Throws
IOException

Protected Methods

protected long readId (DataInput in, byte idType)

Throws
IOException

protected String readString (DataInput in)

Throws
IOException

protected void writeId (DataOutput out, long id, byte idType)

Throws
IOException

protected void writeString (DataOutput out, String string)

Throws
IOException