juglr
Class BoxReader

java.lang.Object
  extended by java.io.Reader
      extended by juglr.BoxReader
All Implemented Interfaces:
java.io.Closeable, java.lang.Readable
Direct Known Subclasses:
JSonBoxReader

public abstract class BoxReader
extends java.io.Reader

A Reader class that outputs a box message as a character stream. You can save system resources by invoking reset(Box) instead of creating new BoxReaders.

See Also:
JSonBoxReader, BoxParser

Field Summary
protected  Box msg
          The message being serialized.
 
Fields inherited from class java.io.Reader
lock
 
Constructor Summary
BoxReader(Box msg)
           
 
Method Summary
abstract  java.lang.String asString()
          Read the entire message an return it as a string
abstract  void reset(Box msg)
          Prepare the reader for serializing another message.
 
Methods inherited from class java.io.Reader
close, mark, markSupported, read, read, read, read, ready, reset, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

msg

protected Box msg
The message being serialized.

Constructor Detail

BoxReader

public BoxReader(Box msg)
Method Detail

reset

public abstract void reset(Box msg)
Prepare the reader for serializing another message.

Parameters:
msg - the message to serialize

asString

public abstract java.lang.String asString()
Read the entire message an return it as a string

Returns:
string representation of the message