@Test public void testWriteObject() throws IOException, ClassNotFoundException { Image image = new Image("http: this.fastJsonObjectOutput.writeObject(image); this.flushToInput(); Image readObjectForImage = fastJsonObjectInput.readObject(Image.class); assertThat(readObjectForImage, not(nullValue())); assertThat(readObjectForImage, is(image)); }
@Override public void writeObject(Object obj) throws IOException { SerializeWriter out = new SerializeWriter(); JSONSerializer serializer = new JSONSerializer(out); serializer.config(SerializerFeature.WriteEnumUsingToString, true); serializer.write(obj); out.writeTo(writer); out.close(); writer.println(); writer.flush(); }
FastJsonObjectOutput implements ObjectOutput { @Override public void writeObject(Object obj) throws IOException { SerializeWriter out = new SerializeWriter(); JSONSerializer serializer = new JSONSerializer(out); serializer.config(SerializerFeature.WriteEnumUsingToString, true); serializer.write(obj); out.writeTo(writer); out.close(); writer.println(); writer.flush(); } }
FastJsonObjectOutput implements ObjectOutput { @Override public void writeObject(Object obj) throws IOException { SerializeWriter out = new SerializeWriter(); JSONSerializer serializer = new JSONSerializer(out); serializer.config(SerializerFeature.WriteEnumUsingToString, true); serializer.write(obj); out.writeTo(writer); out.close(); writer.println(); writer.flush(); } FastJsonObjectOutput(OutputStream out);  FastJsonObjectOutput(Writer writer); }
FastJsonObjectOutput implements ObjectOutput { @Override public void writeObject(Object obj) throws IOException { SerializeWriter out = new SerializeWriter(); JSONSerializer serializer = new JSONSerializer(out); serializer.config(SerializerFeature.WriteEnumUsingToString, true); serializer.write(obj); out.writeTo(writer); out.close(); writer.println(); writer.flush(); } FastJsonObjectOutput(OutputStream out);  FastJsonObjectOutput(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(); }
FastJsonObjectOutput implements ObjectOutput { @Override public void writeObject(Object obj) throws IOException { SerializeWriter out = new SerializeWriter(); JSONSerializer serializer = new JSONSerializer(out); serializer.config(SerializerFeature.WriteEnumUsingToString, true); serializer.write(obj); out.writeTo(writer); out.close(); writer.println(); writer.flush(); } FastJsonObjectOutput(OutputStream out);  FastJsonObjectOutput(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();  }