|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.clazzes.remoting.marshal.impl.MarshalerSupport
org.clazzes.remoting.marshal.impl.JAVAMarshaler
public class JAVAMarshaler
The default implementation of the marshaler, which uses an
ObjectInputStreamWithClassLoader
and an ObjectOutputStream
for deserialization and serialization.
Field Summary | |
---|---|
protected java.io.ObjectInputStream |
ois
|
protected java.io.ObjectOutputStream |
oos
|
Constructor Summary | |
---|---|
JAVAMarshaler()
Default constructor, which set the output and input buffer size to 0. |
|
JAVAMarshaler(int outputBufferSize,
int inputBufferSize)
Construct a JAVAMarshaler, with given input and output buffer sizes. |
Method Summary | |
---|---|
void |
close()
Close the underlying transport and prepare the marshaler for calling Marshaler.setup(OutputStream, InputStream, ClassLoader) again. |
java.lang.Object |
readObject()
Read the next object from the input stream. |
void |
reset()
Reset the state of the serializer. |
void |
setup(java.io.OutputStream os,
java.io.InputStream is,
java.lang.ClassLoader inputClassLoader)
Set up the marshaler for operation. |
protected java.io.ObjectInputStream |
setupObjectInputStream(java.io.InputStream is,
java.lang.ClassLoader inputClassLoader)
|
protected java.io.ObjectOutputStream |
setupObjectOutputStream(java.io.OutputStream os)
|
void |
writeObject(java.lang.Object obj)
Write an object to the underlying transport. |
Methods inherited from class org.clazzes.remoting.marshal.impl.MarshalerSupport |
---|
getInputBufferSize, getOutputBufferSize, prepareInputStream, prepareOutputStream, setInputBufferSize, setOutputBufferSize |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.io.ObjectInputStream ois
protected java.io.ObjectOutputStream oos
Constructor Detail |
---|
public JAVAMarshaler()
public JAVAMarshaler(int outputBufferSize, int inputBufferSize)
outputBufferSize
- The size of the output buffer to use.inputBufferSize
- The size of the input buffer to use.Method Detail |
---|
protected java.io.ObjectOutputStream setupObjectOutputStream(java.io.OutputStream os) throws java.io.IOException
os
- The output stream returned by MarshalerSupport.prepareOutputStream(OutputStream)
.
java.io.IOException
- Upon errors.protected java.io.ObjectInputStream setupObjectInputStream(java.io.InputStream is, java.lang.ClassLoader inputClassLoader) throws java.io.IOException
is
- The input stream as return by MarshalerSupport.prepareInputStream(InputStream)
.inputClassLoader
- The class loader to use for deserialization.
java.io.IOException
- Upon errors setting up the ObjectInputStream.public void setup(java.io.OutputStream os, java.io.InputStream is, java.lang.ClassLoader inputClassLoader) throws java.io.IOException
Marshaler
os
- The output stream to write to.is
- The input stream to read from.inputClassLoader
- The ClassLoader to use for deserialized instances.
java.io.IOException
- Upon errors setting up the streams.public java.lang.Object readObject() throws java.lang.ClassNotFoundException, java.io.IOException
Marshaler
java.lang.ClassNotFoundException
- If the underlying class loader was unable
to find the class of a serialized object.
java.io.IOException
- Upon transport errors.public void reset() throws java.io.IOException
Marshaler
java.io.IOException
- Upon transport errors.public void writeObject(java.lang.Object obj) throws java.io.IOException
Marshaler
obj
- The object to write.
java.io.IOException
- Upon transport errors.public void close()
Marshaler
Marshaler.setup(OutputStream, InputStream, ClassLoader)
again.
This method should be implemented in a fashion that is tolerant for an
incomplete setup of the marshaler. It should even be possible to call
close() twice on a single marshaler object.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |