public class NettyBytableEncoder
extends org.jboss.netty.handler.codec.serialization.ObjectEncoder
Bytable instance to coded bytes array for netty pipeline.| Constructor and Description |
|---|
NettyBytableEncoder()
Creates a new encoder with the estimated length of 64k bytes.
|
NettyBytableEncoder(int estimatedLength)
Creates a new encoder.
|
| Modifier and Type | Method and Description |
|---|---|
protected Object |
encode(org.jboss.netty.channel.ChannelHandlerContext ctx,
org.jboss.netty.channel.Channel channel,
Object msg) |
public NettyBytableEncoder()
public NettyBytableEncoder(int estimatedLength)
estimatedLength - the estimated byte length of the serialized form of an object.If the length of the serialized form
exceeds this value, the internal buffer will be expanded automatically at the cost of memory
bandwidth. If this value is too big, it will also waste memory bandwidth. To avoid unnecessary memory
copy or allocation cost, please specify the properly estimated value.Copyright © 2018. All Rights Reserved.