@ChannelPipelineCoverage(value="one") public class CompatibleObjectEncoder extends OneToOneEncoder
ChannelBuffer
(interoperability version).
This encoder is interoperable with the standard Java object streams such as
ObjectInputStream
and ObjectOutputStream
.
Constructor and Description |
---|
CompatibleObjectEncoder()
Creates a new instance with the reset interval of
16 . |
CompatibleObjectEncoder(int resetInterval)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
protected Object |
encode(ChannelHandlerContext context,
Channel channel,
Object msg) |
protected ObjectOutputStream |
newObjectOutputStream(OutputStream out)
Creates a new
ObjectOutputStream which wraps the specified
OutputStream . |
handleDownstream
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.protected ObjectOutputStream newObjectOutputStream(OutputStream out) throws Exception
ObjectOutputStream
which wraps the specified
OutputStream
. Override this method to use a subclass of the
ObjectOutputStream
.Exception
protected Object encode(ChannelHandlerContext context, Channel channel, Object msg) throws Exception
encode
in class OneToOneEncoder
Exception
Copyright © 2008–2013 JBoss, by Red Hat. All rights reserved.