Class Token
java.lang.Object
com.thoughtworks.xstream.io.binary.Token
- Direct Known Subclasses:
Token.Attribute, Token.EndNode, Token.MapIdToValue, Token.StartNode, Token.Value
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.
- Since:
- 1.2
- Author:
- Joe Walnes
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic classstatic classstatic classstatic class -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected longstatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final byteprotected String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanlonggetId()bytegetType()getValue()inthashCode()abstract voidprotected longprotected StringreadString(DataInput in) toString()protected voidwriteId(DataOutput out, long id, byte idType) protected voidwriteString(DataOutput out, String string) abstract voidwriteTo(DataOutput out, byte idType)
-
Field Details
-
TYPE_VERSION
public static final byte TYPE_VERSION- See Also:
-
TYPE_MAP_ID_TO_VALUE
public static final byte TYPE_MAP_ID_TO_VALUE- See Also:
-
TYPE_START_NODE
public static final byte TYPE_START_NODE- See Also:
-
TYPE_END_NODE
public static final byte TYPE_END_NODE- See Also:
-
TYPE_ATTRIBUTE
public static final byte TYPE_ATTRIBUTE- See Also:
-
TYPE_VALUE
public static final byte TYPE_VALUE- See Also:
-
id
protected long id -
value
-
-
Constructor Details
-
Token
public Token(byte type)
-
-
Method Details
-
getType
public byte getType() -
getId
public long getId() -
getValue
-
toString
-
equals
-
hashCode
-
writeTo
- Throws:
IOException
-
readFrom
- Throws:
IOException
-
writeId
- Throws:
IOException
-
writeString
- Throws:
IOException
-
readId
- Throws:
IOException
-
readString
- Throws:
IOException
-