
com.tencent.trpc.transport.netty.stream.FrameDecoderHandler Maven / Gradle / Ivy
/*
* Tencent is pleased to support the open source community by making tRPC available.
*
* Copyright (C) 2023 THL A29 Limited, a Tencent company.
* All rights reserved.
*
* If you have downloaded a copy of the tRPC source code from Tencent,
* please note that tRPC source code is licensed under the Apache 2.0 License,
* A copy of the Apache 2.0 License can be found in the LICENSE file.
*/
package com.tencent.trpc.transport.netty.stream;
import com.tencent.trpc.core.stream.transport.codec.FrameDecoder;
import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.ByteToMessageDecoder;
import java.util.List;
import java.util.Objects;
/**
* A netty decoder used to decode frames of data of the stream protocol.
*/
public class FrameDecoderHandler extends ByteToMessageDecoder {
/**
* Frame decoder implemented by each protocol.
*/
private final FrameDecoder frameDecoder;
public FrameDecoderHandler(FrameDecoder frameDecoder) {
this.frameDecoder = Objects.requireNonNull(frameDecoder, "frameDecoder is null");
}
@Override
protected void decode(ChannelHandlerContext channelHandlerContext, ByteBuf byteBuf,
List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy