jsdsi.sexp
Class ObjOutputStream

java.lang.Object
  extended byjava.io.OutputStream
      extended byjava.io.FilterOutputStream
          extended byjsdsi.sexp.ObjOutputStream

public class ObjOutputStream
extends java.io.FilterOutputStream

Writes serialized Objs as S-expressions to an underlying stream. Supports the canonical, transport, and readable S-expression encodings.

Author:
Sameer Ajmani
See Also:
SexpOutputStream, ObjInputStream

Field Summary
 
Fields inherited from class java.io.FilterOutputStream
out
 
Constructor Summary
ObjOutputStream(java.io.OutputStream os)
          Creates a new ObjOutputStream that writes to the given stream.
 
Method Summary
 void writeCanonical(Obj o)
          Writes an Obj to the stream as a canonical S-expression.
 void writeReadable(Obj o, int offset, int width, int last)
          Writes an Obj to the stream as a readable S-expression.
 void writeTransport(Obj o)
          Writes an Obj to the stream as a transport S-expression.
 
Methods inherited from class java.io.FilterOutputStream
close, flush, write, write, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ObjOutputStream

public ObjOutputStream(java.io.OutputStream os)
Creates a new ObjOutputStream that writes to the given stream.

Method Detail

writeReadable

public void writeReadable(Obj o,
                          int offset,
                          int width,
                          int last)
                   throws java.io.IOException
Writes an Obj to the stream as a readable S-expression.

Parameters:
o - the Obj to write
offset - spaces indented from left
width - total width of window, in characters
last - spaces reserved on right (e.g., for closing parens)
Throws:
java.io.IOException - if there is an IO error

writeTransport

public void writeTransport(Obj o)
                    throws java.io.IOException
Writes an Obj to the stream as a transport S-expression.

Parameters:
o - the Obj to write
Throws:
java.io.IOException - if there is an IO error

writeCanonical

public void writeCanonical(Obj o)
                    throws java.io.IOException
Writes an Obj to the stream as a canonical S-expression.

Parameters:
o - the Obj to write
Throws:
java.io.IOException - if there is an IO error


Copyright © 2002-2006 JSDSI. All Rights Reserved.