@Test public void shouldMaskFragmentedNonMultipleBufferWithExpressionKey() throws Exception { ExpressionContext environment = new ExpressionContext(); ExpressionFactory factory = ExpressionFactory.newInstance(); ValueExpression expression = factory.createValueExpression(new byte[]{0x01, 0x02, 0x03, 0x04}, byte[].class); Supplier<byte[]> supplier = synchronizedSupplier(expression, environment, byte[].class); Masker decoder = newMasker(supplier); ChannelBuffer originalBuf1 = wrappedBuffer(new byte[]{0x11, 0x12, 0x13, 0x14, 0x11}); ChannelBuffer maskedBuf1 = decoder.applyMask(originalBuf1); ChannelBuffer originalBuf2 = wrappedBuffer(new byte[]{0x22, 0x23, 0x24, 0x21}); ChannelBuffer maskedBuf2 = decoder.applyMask(originalBuf2); assertEquals(wrappedBuffer(new byte[]{0x10, 0x10, 0x10, 0x10, 0x10}), maskedBuf1); assertEquals(wrappedBuffer(new byte[]{0x20, 0x20, 0x20, 0x20}), maskedBuf2); }
public abstract ChannelBuffer applyMask(ChannelBuffer buffer);
Masker { public abstract ChannelBuffer applyMask(ChannelBuffer buffer); }
Masker { public abstract ChannelBuffer applyMask(ChannelBuffer buffer);  }
Masker { public abstract ChannelBuffer applyMask(ChannelBuffer buffer);  abstract ChannelBuffer applyMask(ChannelBuffer buffer); abstract ChannelBuffer undoMask(ChannelBuffer buffer); }
Masker { public abstract ChannelBuffer applyMask(ChannelBuffer buffer);  abstract ChannelBuffer applyMask(ChannelBuffer buffer); abstract ChannelBuffer undoMask(ChannelBuffer buffer); static final Masker IDENTITY_MASKER; }