Top Inners Fields Constructors Methods
com.thoughtworks.xstream.io.binary

public Class BinaryStreamWriter

extends Object
implements ExtendedHierarchicalStreamWriter
Class Inheritance
All Implemented Interfaces
com.thoughtworks.xstream.io.ExtendedHierarchicalStreamWriter, com.thoughtworks.xstream.io.HierarchicalStreamWriter
Imports
com.thoughtworks.xstream.io.HierarchicalStreamWriter, .StreamException, .ExtendedHierarchicalStreamWriter, java.io.DataOutputStream, .OutputStream, .IOException, java.util.Map, .HashMap

Deprecated

as a consequence of ExtendedHierarchicalStreamWriter being deprecated. See corresponding docs for further information.

Since
1.2

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class

Field Summary

Modifier and TypeField and Description
private final BinaryStreamWriter.IdRegistry
private final DataOutputStream
private final Token.Formatter

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
public void
close()

Implements com.thoughtworks.xstream.io.HierarchicalStreamWriter.close.

Close the writer, if necessary.
public void
public void
flush()

Implements com.thoughtworks.xstream.io.HierarchicalStreamWriter.flush.

Flush the writer, if necessary.
public void
setValue(String text)

Implements com.thoughtworks.xstream.io.HierarchicalStreamWriter.setValue.

Write the value (text content) of the current node.
public void
public void
public HierarchicalStreamWriter
underlyingWriter()

Implements com.thoughtworks.xstream.io.HierarchicalStreamWriter.underlyingWriter.

Return the underlying HierarchicalStreamWriter implementation.
private void
write(Token token)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

idRegistryback to summary
private final BinaryStreamWriter.IdRegistry idRegistry
outback to summary
private final DataOutputStream out
tokenFormatterback to summary
private final Token.Formatter tokenFormatter

Constructor Detail

BinaryStreamWriterback to summary
public BinaryStreamWriter(OutputStream outputStream)

Method Detail

addAttributeback to summary
public void addAttribute(String name, String value)

Implements com.thoughtworks.xstream.io.HierarchicalStreamWriter.addAttribute.

closeback to summary
public void close()

Implements com.thoughtworks.xstream.io.HierarchicalStreamWriter.close.

Doc from com.thoughtworks.xstream.io.HierarchicalStreamWriter.close.

Close the writer, if necessary.

endNodeback to summary
public void endNode()

Implements com.thoughtworks.xstream.io.HierarchicalStreamWriter.endNode.

flushback to summary
public void flush()

Implements com.thoughtworks.xstream.io.HierarchicalStreamWriter.flush.

Doc from com.thoughtworks.xstream.io.HierarchicalStreamWriter.flush.

Flush the writer, if necessary.

setValueback to summary
public void setValue(String text)

Implements com.thoughtworks.xstream.io.HierarchicalStreamWriter.setValue.

Doc from com.thoughtworks.xstream.io.HierarchicalStreamWriter.setValue.

Write the value (text content) of the current node.

startNodeback to summary
public void startNode(String name)

Implements com.thoughtworks.xstream.io.HierarchicalStreamWriter.startNode.

startNodeback to summary
public void startNode(String name, Class<T> clazz)

Implements com.thoughtworks.xstream.io.ExtendedHierarchicalStreamWriter.startNode.

underlyingWriterback to summary
public HierarchicalStreamWriter underlyingWriter()

Implements com.thoughtworks.xstream.io.HierarchicalStreamWriter.underlyingWriter.

Doc from com.thoughtworks.xstream.io.HierarchicalStreamWriter.underlyingWriter.

Return the underlying HierarchicalStreamWriter implementation.

If a Converter needs to access methods of a specific HierarchicalStreamWriter implementation that are not defined in the HierarchicalStreamWriter interface, it should call this method before casting. This is because the writer passed to the Converter is often wrapped/decorated by another implementation to provide additional functionality (such as XPath tracking).

For example:

MySpecificWriter mySpecificWriter = (MySpecificWriter)writer; // INCORRECT!
mySpecificWriter.doSomethingSpecific();
MySpecificWriter mySpecificWriter = (MySpecificWriter)writer.underlyingWriter();  // CORRECT!
mySpecificWriter.doSomethingSpecific();

Implementations of HierarchicalStreamWriter should return 'this', unless they are a decorator, in which case they should delegate to whatever they are wrapping.

writeback to summary
private void write(Token token)
com.thoughtworks.xstream.io.binary back to summary

private Class BinaryStreamWriter.IdRegistry

extends Object
Class Inheritance
  • java.lang.Object
  • com.thoughtworks.xstream.io.binary.BinaryStreamWriter.IdRegistry

Field Summary

Modifier and TypeField and Description
private Map<K, V>
private long

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public long
getId(String value)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

idsback to summary
private Map<K, V> ids
nextIdback to summary
private long nextId

Constructor Detail

IdRegistryback to summary
private IdRegistry()

Method Detail

getIdback to summary
public long getId(String value)