1 /* 2 * Copyright 2016 The Netty Project 3 * 4 * The Netty Project licenses this file to you under the Apache License, 5 * version 2.0 (the "License"); you may not use this file except in compliance 6 * with the License. You may obtain a copy of the License at: 7 * 8 * https://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 * License for the specific language governing permissions and limitations 14 * under the License. 15 */ 16 package io.netty.handler.codec.http2; 17 18 import io.netty.buffer.ByteBuf; 19 import io.netty.buffer.ByteBufHolder; 20 21 /** 22 * HTTP/2 DATA frame. 23 */ 24 public interface Http2DataFrame extends Http2StreamFrame, ByteBufHolder { 25 26 /** 27 * Frame padding to use. Will be non-negative and less than 256. 28 */ 29 int padding(); 30 31 /** 32 * Payload of DATA frame. Will not be {@code null}. 33 */ 34 @Override 35 ByteBuf content(); 36 37 /** 38 * Returns the number of bytes that are flow-controlled initially, so even if the {@link #content()} is consumed 39 * this will not change. 40 */ 41 int initialFlowControlledBytes(); 42 43 /** 44 * Returns {@code true} if the END_STREAM flag is set. 45 */ 46 boolean isEndStream(); 47 48 @Override 49 Http2DataFrame copy(); 50 51 @Override 52 Http2DataFrame duplicate(); 53 54 @Override 55 Http2DataFrame retainedDuplicate(); 56 57 @Override 58 Http2DataFrame replace(ByteBuf content); 59 60 @Override 61 Http2DataFrame retain(); 62 63 @Override 64 Http2DataFrame retain(int increment); 65 66 @Override 67 Http2DataFrame touch(); 68 69 @Override 70 Http2DataFrame touch(Object hint); 71 }