@Test
public void testDecodeCopyWith1ByteOffset() throws Exception {

    ByteBuf in = Unpooled.wrappedBuffer(new byte[] {
        0x0a, // preamble length
        0x04 << 2, // literal tag + length
        0x6e, 0x65, 0x74, 0x74, 0x79, // "netty"
        0x01 << 2 | 0x01, // copy with 1-byte offset + length
        0x05 // offset
    });
    ByteBuf out = Unpooled.buffer(10);
    snappy.decode(in, out);
    // "nettynetty" - we saved a whole byte :)
    ByteBuf expected = Unpooled.wrappedBuffer(new byte[] {
        0x6e, 0x65, 0x74, 0x74, 0x79, 0x6e, 0x65, 0x74, 0x74, 0x79
    });
    assertEquals("Copy was not decoded correctly", expected, out);
    in.release();
    out.release();
    expected.release();
}