Home / Function/ decodeCopyWith2ByteOffset() — netty Function Reference

decodeCopyWith2ByteOffset() — netty Function Reference

Architecture documentation for the decodeCopyWith2ByteOffset() function in Snappy.java from the netty codebase.

Function java Buffer Allocators calls 1 called by 1

Entity Profile

Dependency Diagram

graph TD
  5a991b7b_d13e_6b74_df07_e461641c7020["decodeCopyWith2ByteOffset()"]
  6a7984ff_ded6_5ba2_b4bb_f92d0d3986f8["Snappy"]
  5a991b7b_d13e_6b74_df07_e461641c7020 -->|defined in| 6a7984ff_ded6_5ba2_b4bb_f92d0d3986f8
  f2623adf_f9d0_6b9a_01bf_992a8c89c1e8["decode()"]
  f2623adf_f9d0_6b9a_01bf_992a8c89c1e8 -->|calls| 5a991b7b_d13e_6b74_df07_e461641c7020
  9a397f72_75fb_a24a_1007_bc2bd8ca3feb["validateOffset()"]
  5a991b7b_d13e_6b74_df07_e461641c7020 -->|calls| 9a397f72_75fb_a24a_1007_bc2bd8ca3feb
  style 5a991b7b_d13e_6b74_df07_e461641c7020 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec-compression/src/main/java/io/netty/handler/codec/compression/Snappy.java lines 553–582

    private static int decodeCopyWith2ByteOffset(byte tag, ByteBuf in, ByteBuf out, int writtenSoFar) {
        if (in.readableBytes() < 2) {
            return NOT_ENOUGH_INPUT;
        }

        int initialIndex = out.writerIndex();
        int length = 1 + (tag >> 2 & 0x03f);
        int offset = in.readUnsignedShortLE();

        validateOffset(offset, writtenSoFar);

        out.markReaderIndex();
        if (offset < length) {
            int copies = length / offset;
            for (; copies > 0; copies--) {
                out.readerIndex(initialIndex - offset);
                out.readBytes(out, offset);
            }
            if (length % offset != 0) {
                out.readerIndex(initialIndex - offset);
                out.readBytes(out, length % offset);
            }
        } else {
            out.readerIndex(initialIndex - offset);
            out.readBytes(out, length);
        }
        out.resetReaderIndex();

        return length;
    }

Domain

Subdomains

Called By

Frequently Asked Questions

What does decodeCopyWith2ByteOffset() do?
decodeCopyWith2ByteOffset() is a function in the netty codebase, defined in codec-compression/src/main/java/io/netty/handler/codec/compression/Snappy.java.
Where is decodeCopyWith2ByteOffset() defined?
decodeCopyWith2ByteOffset() is defined in codec-compression/src/main/java/io/netty/handler/codec/compression/Snappy.java at line 553.
What does decodeCopyWith2ByteOffset() call?
decodeCopyWith2ByteOffset() calls 1 function(s): validateOffset.
What calls decodeCopyWith2ByteOffset()?
decodeCopyWith2ByteOffset() is called by 1 function(s): decode.

Analyze Your Own Codebase

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

Try Supermodel Free