// Compute length with encoder
int length = codec.encoder.length(type, val, conn);
// 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);
}