public abstract class AbstractHessianOutput
extends java.lang.Object
OutputStream os = ...; // from http connection AbstractOutput out = new HessianSerializerOutput(os); String value; out.startCall("hello"); // start hello call out.writeString("arg1"); // write a string argument out.completeCall(); // complete the call
Modifier and Type | Field and Description |
---|---|
protected SerializerFactory |
_serializerFactory |
Constructor and Description |
---|
AbstractHessianOutput() |
Modifier and Type | Method and Description |
---|---|
abstract boolean |
addRef(java.lang.Object object)
Adds an object to the reference list.
|
void |
call(java.lang.String method,
java.lang.Object[] args)
Writes a complete method call.
|
void |
close() |
abstract void |
completeCall()
Completes the method call:
|
void |
completeReply() |
protected SerializerFactory |
findSerializerFactory()
Gets the serializer factory.
|
void |
flush() |
abstract int |
getRef(java.lang.Object obj) |
SerializerFactory |
getSerializerFactory()
Gets the serializer factory.
|
void |
init(java.io.OutputStream os)
Initialize the output with a new underlying stream.
|
boolean |
removeRef(java.lang.Object obj)
Removes a reference.
|
abstract boolean |
replaceRef(java.lang.Object oldRef,
java.lang.Object newRef)
Replaces a reference from one object to another.
|
void |
resetReferences()
Resets the references for streaming.
|
void |
setSerializerFactory(SerializerFactory factory)
Sets the serializer factory.
|
boolean |
setUnshared(boolean isUnshared) |
abstract void |
startCall()
Starts the method call:
|
abstract void |
startCall(java.lang.String method,
int length)
Starts the method call:
|
void |
startReply() |
abstract void |
writeBoolean(boolean value)
Writes a boolean value to the stream.
|
abstract void |
writeByteBufferEnd(byte[] buffer,
int offset,
int length)
Writes the last chunk of a byte buffer to the stream.
|
abstract void |
writeByteBufferPart(byte[] buffer,
int offset,
int length)
Writes a byte buffer to the stream.
|
abstract void |
writeByteBufferStart()
Writes a byte buffer to the stream.
|
abstract void |
writeBytes(byte[] buffer)
Writes a byte array to the stream.
|
abstract void |
writeBytes(byte[] buffer,
int offset,
int length)
Writes a byte array to the stream.
|
void |
writeByteStream(java.io.InputStream is)
Writes a full output stream.
|
void |
writeClassFieldLength(int len)
Writes the end of the class.
|
abstract void |
writeDouble(double value)
Writes a double value to the stream.
|
void |
writeFault(java.lang.String code,
java.lang.String message,
java.lang.Object detail) |
void |
writeHeader(java.lang.String name)
Deprecated.
|
abstract void |
writeInt(int value)
Writes an integer value to the stream.
|
abstract boolean |
writeListBegin(int length,
java.lang.String type)
Writes the list header to the stream.
|
abstract void |
writeListEnd()
Writes the tail of the list to the stream.
|
abstract void |
writeLong(long value)
Writes a long value to the stream.
|
abstract void |
writeMapBegin(java.lang.String type)
Writes the map header to the stream.
|
abstract void |
writeMapEnd()
Writes the tail of the map to the stream.
|
abstract void |
writeMethod(java.lang.String method)
Writes the method tag.
|
abstract void |
writeNull()
Writes a null value to the stream.
|
abstract void |
writeObject(java.lang.Object object)
Writes a generic object to the output stream.
|
int |
writeObjectBegin(java.lang.String type)
Writes the object header to the stream (for Hessian 2.0), or a
Map for Hessian 1.0.
|
void |
writeObjectEnd()
Writes the tail of the object to the stream.
|
protected abstract void |
writeRef(int value)
Writes a reference.
|
void |
writeReply(java.lang.Object o) |
abstract void |
writeString(char[] buffer,
int offset,
int length)
Writes a string value to the stream using UTF-8 encoding.
|
abstract void |
writeString(java.lang.String value)
Writes a string value to the stream using UTF-8 encoding.
|
abstract void |
writeUTCDate(long time)
Writes a date to the stream.
|
protected SerializerFactory _serializerFactory
public void setSerializerFactory(SerializerFactory factory)
public SerializerFactory getSerializerFactory()
protected final SerializerFactory findSerializerFactory()
public void init(java.io.OutputStream os)
public boolean setUnshared(boolean isUnshared)
public void call(java.lang.String method, java.lang.Object[] args) throws java.io.IOException
java.io.IOException
public abstract void startCall() throws java.io.IOException
C
method
- the method name to call.java.io.IOException
public abstract void startCall(java.lang.String method, int length) throws java.io.IOException
C string int
method
- the method name to call.java.io.IOException
public void writeHeader(java.lang.String name) throws java.io.IOException
java.io.IOException
public abstract void writeMethod(java.lang.String method) throws java.io.IOException
string
method
- the method name to call.java.io.IOException
public abstract void completeCall() throws java.io.IOException
java.io.IOException
public abstract void writeBoolean(boolean value) throws java.io.IOException
T
F
value
- the boolean value to write.java.io.IOException
public abstract void writeInt(int value) throws java.io.IOException
I b32 b24 b16 b8
value
- the integer value to write.java.io.IOException
public abstract void writeLong(long value) throws java.io.IOException
L b64 b56 b48 b40 b32 b24 b16 b8
value
- the long value to write.java.io.IOException
public abstract void writeDouble(double value) throws java.io.IOException
D b64 b56 b48 b40 b32 b24 b16 b8
value
- the double value to write.java.io.IOException
public abstract void writeUTCDate(long time) throws java.io.IOException
T b64 b56 b48 b40 b32 b24 b16 b8
time
- the date in milliseconds from the epoch in UTCjava.io.IOException
public abstract void writeNull() throws java.io.IOException
N
value
- the string value to write.java.io.IOException
public abstract void writeString(java.lang.String value) throws java.io.IOException
S b16 b8 string-value
If the value is null, it will be written as
N
value
- the string value to write.java.io.IOException
public abstract void writeString(char[] buffer, int offset, int length) throws java.io.IOException
S b16 b8 string-value
If the value is null, it will be written as
N
value
- the string value to write.java.io.IOException
public abstract void writeBytes(byte[] buffer) throws java.io.IOException
B b16 b18 bytes
If the value is null, it will be written as
N
value
- the string value to write.java.io.IOException
public abstract void writeBytes(byte[] buffer, int offset, int length) throws java.io.IOException
B b16 b18 bytes
If the value is null, it will be written as
N
value
- the string value to write.java.io.IOException
public abstract void writeByteBufferStart() throws java.io.IOException
java.io.IOException
public abstract void writeByteBufferPart(byte[] buffer, int offset, int length) throws java.io.IOException
b b16 b18 bytes
value
- the string value to write.java.io.IOException
public abstract void writeByteBufferEnd(byte[] buffer, int offset, int length) throws java.io.IOException
b b16 b18 bytes
value
- the string value to write.java.io.IOException
public void writeByteStream(java.io.InputStream is) throws java.io.IOException
java.io.IOException
protected abstract void writeRef(int value) throws java.io.IOException
Q int
value
- the integer value to write.java.io.IOException
public boolean removeRef(java.lang.Object obj) throws java.io.IOException
java.io.IOException
public abstract boolean replaceRef(java.lang.Object oldRef, java.lang.Object newRef) throws java.io.IOException
java.io.IOException
public abstract boolean addRef(java.lang.Object object) throws java.io.IOException
R b32 b24 b16 b8
object
- the object to add as a reference.java.io.IOException
public abstract int getRef(java.lang.Object obj)
obj
- public void resetReferences()
public abstract void writeObject(java.lang.Object object) throws java.io.IOException
java.io.IOException
public abstract boolean writeListBegin(int length, java.lang.String type) throws java.io.IOException
writeListBegin
followed by the list contents and then
call writeListEnd
.
V
x13 java.util.ArrayList # type
x93 # length=3
x91 # 1
x92 # 2
x93 # 3
</list>
java.io.IOException
public abstract void writeListEnd() throws java.io.IOException
java.io.IOException
public abstract void writeMapBegin(java.lang.String type) throws java.io.IOException
writeMapBegin
followed by the map contents and then
call writeMapEnd
.
M type ( )* Z
java.io.IOException
public abstract void writeMapEnd() throws java.io.IOException
java.io.IOException
public int writeObjectBegin(java.lang.String type) throws java.io.IOException
writeObjectBegin
followed by the map contents and then
call writeObjectEnd
.
C type int *
C int *
java.io.IOException
public void writeClassFieldLength(int len) throws java.io.IOException
java.io.IOException
public void writeObjectEnd() throws java.io.IOException
java.io.IOException
public void writeReply(java.lang.Object o) throws java.io.IOException
java.io.IOException
public void startReply() throws java.io.IOException
java.io.IOException
public void completeReply() throws java.io.IOException
java.io.IOException
public void writeFault(java.lang.String code, java.lang.String message, java.lang.Object detail) throws java.io.IOException
java.io.IOException
public void flush() throws java.io.IOException
java.io.IOException
public void close() throws java.io.IOException
java.io.IOException