View Javadoc
1   /*
2    * Copyright 2014 The Netty Project
3    *
4    * The Netty Project licenses this file to you under the Apache License, version 2.0 (the
5    * "License"); you may not use this file except in compliance with the License. You may obtain a
6    * copy of the License at:
7    *
8    * http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software distributed under the License
11   * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
12   * or implied. See the License for the specific language governing permissions and limitations under
13   * the License.
14   */
15  
16  package io.netty.handler.codec.http2;
17  
18  import io.netty.buffer.ByteBuf;
19  
20  /**
21   * Decodes HPACK-encoded headers blocks into {@link Http2Headers}.
22   */
23  public interface Http2HeadersDecoder {
24      /**
25       * Configuration related elements for the {@link Http2HeadersDecoder} interface
26       */
27      interface Configuration {
28          /**
29           * Access the Http2HeaderTable for this {@link Http2HeadersDecoder}
30           */
31          Http2HeaderTable headerTable();
32      }
33  
34      /**
35       * Decodes the given headers block and returns the headers.
36       */
37      Http2Headers decodeHeaders(ByteBuf headerBlock) throws Http2Exception;
38  
39      /**
40       * Get the {@link Configuration} for this {@link Http2HeadersDecoder}
41       */
42      Configuration configuration();
43  }