public class LimitFrameHandler extends Object implements PipeHandler<ByteBuf,ByteBuf>
ByteBuf is split into multiple ByteBuf using a fixed length
Case 1 maxLength = 10 BEFORE (25 bytes) AFTER (25 bytes) +----------+ +----------+----------+---------+ | 25 bytes | -----> | 10 bytes | 10 bytes | 5 bytes | +----------+ +----------+----------+---------+
Case 2 maxLength = 10 BEFORE (14 bytes) AFTER (14 bytes) +------------------------------+ +------------+-----------+ | 3 bytes | 10 bytes | 1 bytes | ---> | (10 bytes) | (4 bytes) | +------------------------------+ +------------+-----------+
| 构造器和说明 |
|---|
LimitFrameHandler(int maxLength)
Creates a new decoder.
|
LimitFrameHandler(int maxLength,
ByteBufAllocator bufAllocator)
Creates a new decoder.
|
| 限定符和类型 | 方法和说明 |
|---|---|
PipeStatus |
onMessage(PipeContext context,
PipeRcvQueue<ByteBuf> src,
PipeSndQueue<ByteBuf> dst) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitonActive, onClose, onError, onInitpublic LimitFrameHandler(int maxLength)
maxLength - the maximum length of the decoded frame.public LimitFrameHandler(int maxLength,
ByteBufAllocator bufAllocator)
maxLength - the maximum length of the decoded frame.public PipeStatus onMessage(PipeContext context, PipeRcvQueue<ByteBuf> src, PipeSndQueue<ByteBuf> dst)
onMessage 在接口中 PipeHandler<ByteBuf,ByteBuf>Copyright © 2022–2024. All rights reserved.