GsonJsonObjectOutput implements ObjectOutput { @Override public void writeBytes(byte[] b) throws IOException { writer.println(new String(b)); } GsonJsonObjectOutput(OutputStream out);  GsonJsonObjectOutput(Writer writer); @Override void writeBool(boolean v); @Override void writeByte(byte v); @Override void writeShort(short v); @Override void writeInt(int v); @Override void writeLong(long v); @Override void writeFloat(float v); @Override void writeDouble(double v); @Override void writeUTF(String v); @Override void writeBytes(byte[] b); @Override void writeBytes(byte[] b, int off, int len); @Override void writeObject(Object obj); @Override void flushBuffer();  }
@Test public void testWriteBytes() throws IOException { this.gsonJsonObjectOutput.writeBytes("hello".getBytes()); this.flushToInput(); assertThat(this.gsonJsonObjectInput.readBytes(), is("hello".getBytes())); }
@Test public void testWriteBytesWithSubLength() throws IOException { this.gsonJsonObjectOutput.writeBytes("hello".getBytes(), 2, 2); this.flushToInput(); assertThat(this.gsonJsonObjectInput.readBytes(), is("ll".getBytes())); }