Home / Function/ decodeCopyWith1ByteOffset() — netty Function Reference

decodeCopyWith1ByteOffset() — netty Function Reference

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

Function java Buffer Allocators calls 1 called by 1

Entity Profile

Dependency Diagram

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

Relationship Graph

Source Code

codec-compression/src/main/java/io/netty/handler/codec/compression/Snappy.java lines 509–538

    private static int decodeCopyWith1ByteOffset(byte tag, ByteBuf in, ByteBuf out, int writtenSoFar) {
        if (!in.isReadable()) {
            return NOT_ENOUGH_INPUT;
        }

        int initialIndex = out.writerIndex();
        int length = 4 + ((tag & 0x01c) >> 2);
        int offset = (tag & 0x0e0) << 8 >> 5 | in.readUnsignedByte();

        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 decodeCopyWith1ByteOffset() do?
decodeCopyWith1ByteOffset() is a function in the netty codebase, defined in codec-compression/src/main/java/io/netty/handler/codec/compression/Snappy.java.
Where is decodeCopyWith1ByteOffset() defined?
decodeCopyWith1ByteOffset() is defined in codec-compression/src/main/java/io/netty/handler/codec/compression/Snappy.java at line 509.
What does decodeCopyWith1ByteOffset() call?
decodeCopyWith1ByteOffset() calls 1 function(s): validateOffset.
What calls decodeCopyWith1ByteOffset()?
decodeCopyWith1ByteOffset() 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