public static int computeFrameLength() { int length = FrameHeaderFlyweight.computeFrameHeaderLength(FrameType.REQUEST_N, 0, 0); return length + Integer.BYTES; }
public static int computeFrameLength(final int dataLength) { int length = FrameHeaderFlyweight.computeFrameHeaderLength(FrameType.ERROR, null, dataLength); return length + Integer.BYTES; }
public static int computeFrameLength(final int metadataLength) { int length = FrameHeaderFlyweight.computeFrameHeaderLength(FrameType.LEASE, metadataLength, 0); return length + Integer.BYTES * 2; }
public static int computeFrameLength(final int dataLength) { return FrameHeaderFlyweight.computeFrameHeaderLength(FrameType.SETUP, null, dataLength) + Long.BYTES; }
public static int computeFrameLength( final FrameType type, final @Nullable Integer metadataLength, final int dataLength) { int length = FrameHeaderFlyweight.computeFrameHeaderLength(type, metadataLength, dataLength); if (type.hasInitialRequestN()) { length += Integer.BYTES; } return length; }
private static int computeFrameLength( final int flags, final int resumeTokenLength, final String metadataMimeType, final String dataMimeType, final int metadataLength, final int dataLength) { int length = FrameHeaderFlyweight.computeFrameHeaderLength(FrameType.SETUP, metadataLength, dataLength); length += Integer.BYTES * 3; if ((flags & FLAGS_RESUME_ENABLE) != 0) { length += Short.BYTES + resumeTokenLength; } length += 1 + metadataMimeType.getBytes(StandardCharsets.UTF_8).length; length += 1 + dataMimeType.getBytes(StandardCharsets.UTF_8).length; return length; }
public static Frame from( int streamId, FrameType type, @Nullable ByteBuf metadata, ByteBuf data, int flags) { final Frame frame = RECYCLER.get(); frame.setRefCnt(1); frame.content = ByteBufAllocator.DEFAULT.buffer( FrameHeaderFlyweight.computeFrameHeaderLength( type, metadata != null ? metadata.readableBytes() : null, data.readableBytes())); frame.content.writerIndex( FrameHeaderFlyweight.encode(frame.content, streamId, flags, type, metadata, data)); return frame; } }
public static Frame from(int streamId) { final Frame frame = RECYCLER.get(); frame.setRefCnt(1); frame.content = ByteBufAllocator.DEFAULT.buffer( FrameHeaderFlyweight.computeFrameHeaderLength(FrameType.CANCEL, null, 0)); frame.content.writerIndex( FrameHeaderFlyweight.encode( frame.content, streamId, 0, FrameType.CANCEL, null, Unpooled.EMPTY_BUFFER)); return frame; } }
computeFrameHeaderLength( frameType, metadata != null ? metadata.readableBytes() : null, data.readableBytes());
public static int computeFrameLength(final int metadataLength) { int length = FrameHeaderFlyweight.computeFrameHeaderLength(FrameType.LEASE, metadataLength, 0); return length + Integer.BYTES * 2; }
public static int computeFrameLength(final int dataLength) { int length = FrameHeaderFlyweight.computeFrameHeaderLength(FrameType.ERROR, null, dataLength); return length + Integer.BYTES; }
public static int computeFrameLength() { int length = FrameHeaderFlyweight.computeFrameHeaderLength(FrameType.REQUEST_N, 0, 0); return length + Integer.BYTES; }
public static int computeFrameLength(final int dataLength) { return FrameHeaderFlyweight.computeFrameHeaderLength(FrameType.SETUP, null, dataLength) + Long.BYTES; }
public static int computeFrameLength( final FrameType type, final @Nullable Integer metadataLength, final int dataLength) { int length = FrameHeaderFlyweight.computeFrameHeaderLength(type, metadataLength, dataLength); if (type.hasInitialRequestN()) { length += Integer.BYTES; } return length; }
public static Frame from( int streamId, FrameType type, @Nullable ByteBuf metadata, ByteBuf data, int flags) { final Frame frame = RECYCLER.get(); frame.setRefCnt(1); frame.content = ByteBufAllocator.DEFAULT.buffer( FrameHeaderFlyweight.computeFrameHeaderLength( type, metadata != null ? metadata.readableBytes() : null, data.readableBytes())); frame.content.writerIndex( FrameHeaderFlyweight.encode(frame.content, streamId, flags, type, metadata, data)); return frame; } }
private static int computeFrameLength( final int flags, final int resumeTokenLength, final String metadataMimeType, final String dataMimeType, final int metadataLength, final int dataLength) { int length = FrameHeaderFlyweight.computeFrameHeaderLength(FrameType.SETUP, metadataLength, dataLength); length += Integer.BYTES * 3; if ((flags & FLAGS_RESUME_ENABLE) != 0) { length += Short.BYTES + resumeTokenLength; } length += 1 + metadataMimeType.getBytes(StandardCharsets.UTF_8).length; length += 1 + dataMimeType.getBytes(StandardCharsets.UTF_8).length; return length; }
public static Frame from(int streamId) { final Frame frame = RECYCLER.get(); frame.setRefCnt(1); frame.content = ByteBufAllocator.DEFAULT.buffer( FrameHeaderFlyweight.computeFrameHeaderLength(FrameType.CANCEL, null, 0)); frame.content.writerIndex( FrameHeaderFlyweight.encode( frame.content, streamId, 0, FrameType.CANCEL, null, Unpooled.EMPTY_BUFFER)); return frame; } }
computeFrameHeaderLength( frameType, metadata != null ? metadata.readableBytes() : null, data.readableBytes());