|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jboss.netty.handler.codec.oneone.OneToOneEncoder
org.jboss.netty.handler.codec.serialization.CompatibleObjectEncoder
public class CompatibleObjectEncoder
An encoder which serializes a Java object into a ChannelBuffer
(interoperability version).
This encoder is interoperable with the standard Java object streams such as
ObjectInputStream and ObjectOutputStream.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface org.jboss.netty.channel.ChannelHandler |
|---|
ChannelHandler.Sharable |
| Constructor Summary | |
|---|---|
CompatibleObjectEncoder()
Creates a new instance with the reset interval of 16. |
|
CompatibleObjectEncoder(int resetInterval)
Creates a new instance. |
|
| Method Summary | |
|---|---|
protected java.lang.Object |
encode(ChannelHandlerContext context,
Channel channel,
java.lang.Object msg)
Transforms the specified message into another message and return the transformed message. |
protected java.io.ObjectOutputStream |
newObjectOutputStream(java.io.OutputStream out)
Creates a new ObjectOutputStream which wraps the specified
OutputStream. |
| Methods inherited from class org.jboss.netty.handler.codec.oneone.OneToOneEncoder |
|---|
handleDownstream |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CompatibleObjectEncoder()
16.
public CompatibleObjectEncoder(int resetInterval)
resetInterval - the number of objects between ObjectOutputStream.reset().
0 will disable resetting the stream, but the remote
peer will be at the risk of getting OutOfMemoryError in
the long term.| Method Detail |
|---|
protected java.io.ObjectOutputStream newObjectOutputStream(java.io.OutputStream out)
throws java.lang.Exception
ObjectOutputStream which wraps the specified
OutputStream. Override this method to use a subclass of the
ObjectOutputStream.
java.lang.Exception
protected java.lang.Object encode(ChannelHandlerContext context,
Channel channel,
java.lang.Object msg)
throws java.lang.Exception
OneToOneEncodernull, unlike
you can in OneToOneDecoder.decode(ChannelHandlerContext, Channel, Object);
you must return something, at least ChannelBuffers.EMPTY_BUFFER.
encode in class OneToOneEncoderjava.lang.Exception
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||