public class FtpDataModeCodec
extends io.netty.handler.codec.ByteToMessageCodec<org.waarp.common.file.DataBlock>
DataBlock
and transforms it to a ByteBufDataBlock
Constructor and Description |
---|
FtpDataModeCodec(FtpArgumentCode.TransferMode mode,
FtpArgumentCode.TransferStructure structure) |
Modifier and Type | Method and Description |
---|---|
protected void |
decode(io.netty.channel.ChannelHandlerContext ctx,
io.netty.buffer.ByteBuf buf,
List<Object> out) |
protected org.waarp.common.file.DataBlock |
decodeRecord(io.netty.buffer.ByteBuf buf,
int length) |
protected org.waarp.common.file.DataBlock |
decodeRecordStandard(io.netty.buffer.ByteBuf buf,
int length) |
protected void |
encode(io.netty.channel.ChannelHandlerContext ctx,
org.waarp.common.file.DataBlock msg,
io.netty.buffer.ByteBuf out) |
protected io.netty.buffer.ByteBuf |
encode(org.waarp.common.file.DataBlock msg)
Encode a DataBlock in the correct format for Mode
|
protected io.netty.buffer.ByteBuf |
encodeRecord(org.waarp.common.file.DataBlock msg,
io.netty.buffer.ByteBuf buffer) |
protected io.netty.buffer.ByteBuf |
encodeRecordStandard(org.waarp.common.file.DataBlock msg,
io.netty.buffer.ByteBuf buffer) |
FtpArgumentCode.TransferMode |
getMode() |
FtpArgumentCode.TransferStructure |
getStructure() |
void |
setCodecReady()
Inform the Codec that DataNetworkHandler is ready (called from DataNetworkHandler after
setCorrectCodec).
|
void |
setMode(FtpArgumentCode.TransferMode mode) |
void |
setStructure(FtpArgumentCode.TransferStructure structure) |
acceptOutboundMessage, channelInactive, channelRead, channelReadComplete, decodeLast, handlerAdded, handlerRemoved, write
bind, close, connect, deregister, disconnect, flush, read
channelActive, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught, userEventTriggered
public FtpDataModeCodec(FtpArgumentCode.TransferMode mode, FtpArgumentCode.TransferStructure structure)
mode
- structure
- public void setCodecReady()
protected org.waarp.common.file.DataBlock decodeRecordStandard(io.netty.buffer.ByteBuf buf, int length)
protected org.waarp.common.file.DataBlock decodeRecord(io.netty.buffer.ByteBuf buf, int length)
protected void decode(io.netty.channel.ChannelHandlerContext ctx, io.netty.buffer.ByteBuf buf, List<Object> out) throws Exception
decode
in class io.netty.handler.codec.ByteToMessageCodec<org.waarp.common.file.DataBlock>
Exception
protected io.netty.buffer.ByteBuf encodeRecordStandard(org.waarp.common.file.DataBlock msg, io.netty.buffer.ByteBuf buffer)
protected io.netty.buffer.ByteBuf encodeRecord(org.waarp.common.file.DataBlock msg, io.netty.buffer.ByteBuf buffer)
protected io.netty.buffer.ByteBuf encode(org.waarp.common.file.DataBlock msg) throws org.waarp.common.exception.InvalidArgumentException
msg
- org.waarp.common.exception.InvalidArgumentException
public FtpArgumentCode.TransferMode getMode()
public void setMode(FtpArgumentCode.TransferMode mode)
mode
- the mode to setpublic FtpArgumentCode.TransferStructure getStructure()
public void setStructure(FtpArgumentCode.TransferStructure structure)
structure
- the structure to setCopyright © 2009–2019 Waarp. All rights reserved.