Home / File/ ReadOnlyHttp2Headers.java — netty Source File

ReadOnlyHttp2Headers.java — netty Source File

Architecture documentation for ReadOnlyHttp2Headers.java, a java file in the netty codebase.

Entity Profile

Relationship Graph

Source Code

/*
 * Copyright 2016 The Netty Project
 *
 * The Netty Project licenses this file to you under the Apache License,
 * version 2.0 (the "License"); you may not use this file except in compliance
 * with the License. You may obtain a copy of the License at:
 *
 *   https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations
 * under the License.
 */
package io.netty.handler.codec.http2;

import io.netty.handler.codec.Headers;
import io.netty.util.AsciiString;
import io.netty.util.HashingStrategy;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.NoSuchElementException;
import java.util.Set;

import static io.netty.handler.codec.CharSequenceValueConverter.*;
import static io.netty.handler.codec.http2.DefaultHttp2Headers.*;
import static io.netty.util.AsciiString.*;
import static io.netty.util.internal.EmptyArrays.*;
import static io.netty.util.internal.ObjectUtil.checkNotNullArrayParam;

/**
 * A variant of {@link Http2Headers} which only supports read-only methods.
 * <p>
 * Any array passed to this class may be used directly in the underlying data structures of this class. If these
 * arrays may be modified it is the caller's responsibility to supply this class with a copy of the array.
 * <p>
 * This may be a good alternative to {@link DefaultHttp2Headers} if your have a fixed set of headers which will not
 * change.
 */
public final class ReadOnlyHttp2Headers implements Http2Headers {
    private static final byte PSEUDO_HEADER_TOKEN = (byte) ':';
    private final AsciiString[] pseudoHeaders;
    private final AsciiString[] otherHeaders;

    /**
     * Used to create read only object designed to represent trailers.
     * <p>
     * If this is used for a purpose other than trailers you may violate the header serialization ordering defined by
     * <a href="https://tools.ietf.org/html/rfc7540#section-8.1.2.1">RFC 7540, 8.1.2.1</a>.
     * @param validateHeaders {@code true} will run validation on each header name/value pair to ensure protocol
     *                        compliance.
     * @param otherHeaders An array of key:value pairs. Must not contain any
     *                     <a href="https://tools.ietf.org/html/rfc7540#section-8.1.2.1">pseudo headers</a>
     *                     or {@code null} names/values.
// ... (833 more lines)

Domain

Subdomains

Frequently Asked Questions

What does ReadOnlyHttp2Headers.java do?
ReadOnlyHttp2Headers.java is a source file in the netty codebase, written in java. It belongs to the Buffer domain, Allocators subdomain.
Where is ReadOnlyHttp2Headers.java in the architecture?
ReadOnlyHttp2Headers.java is located at codec-http2/src/main/java/io/netty/handler/codec/http2/ReadOnlyHttp2Headers.java (domain: Buffer, subdomain: Allocators, directory: codec-http2/src/main/java/io/netty/handler/codec/http2).

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free