@Test(expected = DecompressionException.class)
public void testDecodeWithOverlyLongPreamble() throws Exception {

    ByteBuf in = Unpooled.wrappedBuffer(new byte[] {
        -0x80, -0x80, -0x80, -0x80, 0x7f, // preamble length
        0x04 << 2, // literal tag + length
        0x6e, 0x65, 0x74, 0x74, 0x79, // "netty"
    });
    ByteBuf out = Unpooled.buffer(10);
    try {
        snappy.decode(in, out);
    } finally {
        in.release();
        out.release();
    }
}