### Question:
MemcmpEncoder extends Encoder { @Override public void writeBytes(ByteBuffer bytes) throws IOException { writeBytes(bytes.array(), bytes.position(), bytes.remaining()); } MemcmpEncoder(OutputStream out); @Override void flush(); @Override void writeNull(); @Override void writeBoolean(boolean b); @Override void writeInt(int n); @Override void writeLong(long n); @Override void writeFloat(float f); @Override void writeDouble(double d); @Override void writeString(Utf8 utf8); @Override void writeFixed(byte[] bytes, int start, int len); @Override void writeBytes(ByteBuffer bytes); @Override void writeBytes(byte[] bytes, int start, int len); @Override void writeEnum(int e); @Override void writeArrayStart(); @Override void setItemCount(long itemCount); @Override void startItem(); @Override void writeArrayEnd(); @Override void writeMapStart(); @Override void writeMapEnd(); @Override void writeIndex(int unionIndex);  }### Answer:
@Test public void testWriteBytes() throws Exception { encoder.writeBytes(new byte[] { (byte) 0x01, (byte) 0x00, (byte) 0xff }, 0, 3); assertArrayEquals(new byte[] { (byte) 0x01, (byte) 0x00, (byte) 0x01, (byte) 0xff, (byte) 0x00, (byte) 0x00 }, byteOutputStream.toByteArray()); }