private static int decodeRleBlock()

in java/src/main/java/com/epam/deltix/zstd/ZstdFrameDecompressor.java [245:277]


    private static int decodeRleBlock(final int size, final ByteBuffer inputBase, final int inputAddress,
                                      final ByteBuffer outputBase, final int outputAddress, final int outputLimit) {
        verify(outputAddress + size <= outputLimit, inputAddress, "Output buffer too small");

        int output = outputAddress;
        final long value = inputBase.get(inputAddress) & 0xFFL;

        int remaining = size;
        if (remaining >= SIZE_OF_LONG) {
            final long packed = value
                    | (value << 8)
                    | (value << 16)
                    | (value << 24)
                    | (value << 32)
                    | (value << 40)
                    | (value << 48)
                    | (value << 56);

            do {
                outputBase.putLong(output, packed);
                output += SIZE_OF_LONG;
                remaining -= SIZE_OF_LONG;
            }
            while (remaining >= SIZE_OF_LONG);
        }

        for (int i = 0; i < remaining; i++) {
            outputBase.put(output, (byte) value);
            output++;
        }

        return size;
    }