Examples of writeObject()


Examples of com.fasterxml.jackson.core.JsonGenerator.writeObject()

        throws IOException
    {
        JsonFactory jf = new MappingJsonFactory();
        StringWriter sw = new StringWriter();
        JsonGenerator gen = jf.createGenerator(sw);
        gen.writeObject(new Pojo());
        gen.close();
        // trimming needed if main-level object has leading space
        String act = sw.toString().trim();
        assertEquals("{\"x\":4}", act);
    }
View Full Code Here

Examples of com.fasterxml.jackson.databind.util.TokenBuffer.writeObject()

    }

    public void testEmbeddedByteArray() throws Exception
    {
        TokenBuffer buf = new TokenBuffer(MAPPER, false);
        buf.writeObject(new byte[3]);
        JsonNode node = MAPPER.readTree(buf.asParser());
        buf.close();
        assertTrue(node.isBinary());
        byte[] data = node.binaryValue();
        assertNotNull(data);
View Full Code Here

Examples of com.fasterxml.jackson.dataformat.xml.ser.ToXmlGenerator.writeObject()

        values.add(new Value(13));
        values.add(new Value(456));
        for (Value value : values) {
            generator.writeFieldName("foo");
            generator.setNextName(new QName("item"));
            generator.writeObject(value);
        }
        generator.writeEndObject();
        generator.close();
       
        String xml = sw.toString();
View Full Code Here

Examples of com.google.gwt.user.client.rpc.SerializationStreamWriter.writeObject()

                // Serialize the object
                if (this.object instanceof String) {
                    objectWriter.writeString((String) this.object);
                } else {
                    objectWriter.writeObject(this.object);
                }

                setText(objectWriter.toString());
            } catch (Exception e) {
                e.printStackTrace();
View Full Code Here

Examples of com.google.gwt.user.client.rpc.impl.ClientSerializationStreamWriter.writeObject()

    if (getPushMode() == SerialMode.RPC) {
      try {
        Serializer serializer = getSerializer();
        ClientSerializationStreamWriter writer = new ClientSerializationStreamWriter(serializer, GWT.getModuleBaseURL(), GWT.getPermutationStrongName());
                writer.prepareToWrite();
                writer.writeObject(message);
        return writer.toString();
      }
      catch (RuntimeException e) {
        throw new SerializationException(e);
      }
View Full Code Here

Examples of com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.writeObject()

  protected String serialize(Serializable message) throws NotSerializableException, UnsupportedEncodingException {
    try {
      if (clientOracle == null) {
        ServerSerializationStreamWriter streamWriter = new ServerSerializationStreamWriter(serializationPolicy);
        streamWriter.prepareToWrite();
        streamWriter.writeObject(message);
        return streamWriter.toString();
      }
      else {
        ByteArrayOutputStream result = new ByteArrayOutputStream();
        RPC.streamResponseForSuccess(clientOracle, result, message);
View Full Code Here

Examples of com.granule.json.internal.Serializer.writeObject()

        } else {
            serializer = new Serializer(writer);
        }

        try {
            serializer.writeObject(this);
        } catch (IOException iox) {
            JSONException jex = new JSONException("Error occurred during input read.");
            jex.initCause(iox);
            throw jex;
        }
View Full Code Here

Examples of com.hazelcast.nio.BufferObjectDataOutput.writeObject()

        if (!running) return;
        final BufferObjectDataOutput out = sendOutput;
        synchronized (sendLock) {
            try {
                out.writeByte(Packet.VERSION);
                out.writeObject(joinMessage);
                datagramPacketSend.setData(out.toByteArray());
                multicastSocket.send(datagramPacketSend);
                out.clear();
            } catch (IOException e) {
                logger.warning("You probably have too long Hazelcast configuration!", e);
View Full Code Here

Examples of com.hazelcast.nio.ObjectDataOutput.writeObject()

        writer.writeInt("size", keys.size());
        ObjectDataOutput output = writer.getRawDataOutput();
        for (Data key : keys) {
            key.writeData(output);
        }
        output.writeObject(processor);
    }

    @Override
    public void read(PortableReader reader) throws IOException {
        name = reader.readUTF("n");
View Full Code Here

Examples of com.hazelcast.nio.serialization.SerializationService.writeObject()

        SerializationService serializationService = nodeEngine.getSerializationService();
        BufferObjectDataOutput out = serializationService.createObjectDataOutput(1024 * 32);
        try {
            out.writeInt(tasks.size());
            for (Operation task : tasks) {
                serializationService.writeObject(out, task);
            }
            data = out.toByteArray();
        } finally {
            closeResource(out);
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.