com.caucho.hessian.io
Class HessianSerializerOutput

java.lang.Object
  extended by com.caucho.hessian.io.AbstractHessianOutput
      extended by com.caucho.hessian.io.Hessian2Output
          extended by com.caucho.hessian.io.HessianSerializerOutput
All Implemented Interfaces:
Hessian2Constants

public class HessianSerializerOutput
extends Hessian2Output

Output stream for Hessian requests.

HessianOutput is unbuffered, so any client needs to provide its own buffering.

Serialization

 OutputStream os = new FileOutputStream("test.xml");
 HessianOutput out = new HessianSerializerOutput(os);

 out.writeObject(obj);
 os.close();
 

Writing an RPC Call

 OutputStream os = ...; // from http connection
 HessianOutput out = new HessianSerializerOutput(os);
 String value;

 out.startCall("hello");  // start hello call
 out.writeString("arg1"); // write a string argument
 out.completeCall();      // complete the call
 


Field Summary
 
Fields inherited from class com.caucho.hessian.io.Hessian2Output
_os, SIZE
 
Fields inherited from class com.caucho.hessian.io.AbstractHessianOutput
_serializerFactory
 
Fields inherited from interface com.caucho.hessian.io.Hessian2Constants
BC_BINARY, BC_BINARY_CHUNK, BC_BINARY_DIRECT, BC_BINARY_SHORT, BC_CLASS_DEF, BC_DATE, BC_DATE_MINUTE, BC_DOUBLE, BC_DOUBLE_BYTE, BC_DOUBLE_MILL, BC_DOUBLE_ONE, BC_DOUBLE_SHORT, BC_DOUBLE_ZERO, BC_END, BC_FALSE, BC_INT, BC_INT_BYTE_ZERO, BC_INT_SHORT_ZERO, BC_INT_ZERO, BC_LIST_DIRECT, BC_LIST_DIRECT_UNTYPED, BC_LIST_FIXED, BC_LIST_FIXED_UNTYPED, BC_LIST_VARIABLE, BC_LIST_VARIABLE_UNTYPED, BC_LONG, BC_LONG_BYTE_ZERO, BC_LONG_INT, BC_LONG_SHORT_ZERO, BC_LONG_ZERO, BC_MAP, BC_MAP_UNTYPED, BC_NULL, BC_OBJECT, BC_OBJECT_DEF, BC_OBJECT_DIRECT, BC_REF, BC_STRING, BC_STRING_CHUNK, BC_STRING_DIRECT, BC_STRING_SHORT, BC_TRUE, BINARY_DIRECT_MAX, BINARY_SHORT_MAX, INT_BYTE_MAX, INT_BYTE_MIN, INT_DIRECT_MAX, INT_DIRECT_MIN, INT_SHORT_MAX, INT_SHORT_MIN, LIST_DIRECT_MAX, LONG_BYTE_MAX, LONG_BYTE_MIN, LONG_DIRECT_MAX, LONG_DIRECT_MIN, LONG_SHORT_MAX, LONG_SHORT_MIN, OBJECT_DIRECT_MAX, P_PACKET, P_PACKET_CHUNK, P_PACKET_DIRECT, P_PACKET_SHORT, PACKET_DIRECT_MAX, PACKET_SHORT_MAX, STRING_DIRECT_MAX, STRING_SHORT_MAX
 
Constructor Summary
HessianSerializerOutput()
          Creates an uninitialized Hessian output stream.
HessianSerializerOutput(java.io.OutputStream os)
          Creates a new Hessian output stream, initialized with an underlying output stream.
 
Method Summary
 void writeObjectImpl(java.lang.Object obj)
          Applications which override this can do custom serialization.
 
Methods inherited from class com.caucho.hessian.io.Hessian2Output
addRef, call, close, completeCall, completeEnvelope, completeMessage, completeReply, endPacket, flush, flushBuffer, free, getBytesOutputStream, getRef, init, initPacket, isCloseStreamOnClose, printLenString, printString, printString, printString, removeRef, replaceRef, reset, resetReferences, setCloseStreamOnClose, setUnshared, startCall, startCall, startEnvelope, startMessage, startPacket, startReply, writeBoolean, writeByteBufferEnd, writeByteBufferPart, writeByteBufferStart, writeBytes, writeBytes, writeByteStream, writeClassFieldLength, writeDouble, writeFault, writeInt, writeListBegin, writeListEnd, writeLong, writeMapBegin, writeMapEnd, writeMethod, writeNull, writeObject, writeObjectBegin, writeObjectEnd, writeRef, writeStreamingObject, writeString, writeString, writeUTCDate, writeVersion
 
Methods inherited from class com.caucho.hessian.io.AbstractHessianOutput
findSerializerFactory, getSerializerFactory, setSerializerFactory, writeHeader, writeReply
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HessianSerializerOutput

public HessianSerializerOutput(java.io.OutputStream os)
Creates a new Hessian output stream, initialized with an underlying output stream.

Parameters:
os - the underlying output stream.

HessianSerializerOutput

public HessianSerializerOutput()
Creates an uninitialized Hessian output stream.

Method Detail

writeObjectImpl

public void writeObjectImpl(java.lang.Object obj)
                     throws java.io.IOException
Applications which override this can do custom serialization.

Parameters:
object - the object to write.
Throws:
java.io.IOException