// Compute length using null channel buffer
NullByteBuf lengthComputer = new NullByteBuf();
codec.encoder.encode(type, lengthComputer, val, conn);
assertEquals(typeName + " computes length incorrectly", lengthComputer.readableBytes(), length);
}
private void assertStreamEquals(InputStream expected, InputStream actual) throws IOException {
expected.reset();
actual.reset();