FastJsonObjectInput implements ObjectInput { @Override public byte[] readBytes() throws IOException { return readLine().getBytes(); } FastJsonObjectInput(InputStream in);  FastJsonObjectInput(Reader reader); @Override boolean readBool(); @Override byte readByte(); @Override short readShort(); @Override int readInt(); @Override long readLong(); @Override float readFloat(); @Override double readDouble(); @Override String readUTF(); @Override byte[] readBytes(); @Override Object readObject(); @Override T readObject(Class<T> cls); @Override @SuppressWarnings("unchecked") T readObject(Class<T> cls, Type type);  }
@Test public void testReadBytes() throws IOException { fastJsonObjectInput = new FastJsonObjectInput(new ByteArrayInputStream("123456".getBytes())); byte[] result = fastJsonObjectInput.readBytes(); assertThat(result, is("123456".getBytes())); }