Example usage for java.io ObjectOutput writeObject

List of usage examples for java.io ObjectOutput writeObject

Introduction

In this page you can find the example usage for java.io ObjectOutput writeObject.

Prototype

public void writeObject(Object obj) throws IOException;

Source Link

Document

Write an object to the underlying storage or stream.

Usage

From source file:Clock.java

public void writeExternal(ObjectOutput out) throws IOException {
    out.writeBoolean(isDigital);/* w  w w .ja v a 2s .c o  m*/
    out.writeObject(getBackground());
    out.writeObject(getForeground());
    out.writeObject(getPreferredSize());
}

From source file:ca.uhn.fhir.model.api.BasePrimitive.java

@Override
public void writeExternal(ObjectOutput theOut) throws IOException {
    theOut.writeObject(getValueAsString());
}

From source file:org.marketcetera.util.ws.wrappers.RemoteException.java

@Override
public void writeExternal(ObjectOutput out) throws IOException {
    out.writeObject(getProperties());
}

From source file:MemComboBoxDemo.java

public void save(String fName) {
    try {/*  ww w.  j a va  2  s .  co m*/
        FileOutputStream fStream = new FileOutputStream(fName);
        ObjectOutput stream = new ObjectOutputStream(fStream);

        stream.writeObject(getModel());

        stream.flush();
        stream.close();
        fStream.close();
    } catch (Exception e) {
        System.err.println("Serialization error: " + e.toString());
    }
}

From source file:com.gsma.mobileconnect.discovery.DiscoveryResponseTest.java

private DiscoveryResponse roundTripSerialize(DiscoveryResponse in) throws IOException, ClassNotFoundException {
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    ObjectOutput output = new ObjectOutputStream(baos);

    output.writeObject(in);

    output.close();/* w  w w . j  av  a2s  . co  m*/

    ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
    ObjectInput input = new ObjectInputStream(bais);

    DiscoveryResponse out = (DiscoveryResponse) input.readObject();

    input.close();

    return out;
}

From source file:com.splicemachine.derby.stream.output.direct.DirectTableWriterBuilder.java

@Override
public void writeExternal(ObjectOutput out) throws IOException {
    out.writeLong(destConglomerate);/*www. j a  va  2 s .  com*/
    out.writeObject(opCtx);
    out.writeBoolean(skipIndex);
    SIDriver.driver().getOperationFactory().writeTxn(txn, out);
}

From source file:org.nuxeo.ecm.platform.ui.web.binding.MetaMethodExpression.java

public void writeExternal(ObjectOutput out) throws IOException {
    out.writeObject(originalMethodExpression);
}

From source file:org.apache.lens.lib.query.WrappedFileFormatter.java

@Override
public void writeExternal(ObjectOutput out) throws IOException {
    out.writeObject(formatter);
}

From source file:xbird.xquery.dm.value.sequence.EncodedSequence.java

public void writeExternal(ObjectOutput out) throws IOException {
    doEncode();/*w  w w. j a  va 2  s  .  c om*/
    out.writeObject(type);

    final byte[] b = encodedSequence;
    if (b == null) {
        throw new IllegalStateException();
    }
    IOUtils.writeBytes(b, out);
}

From source file:com.talis.storage.s3.ExternalizableS3Object.java

@Override
public void writeExternal(ObjectOutput out) throws IOException {
    out.writeUTF(getKey());/*from   ww w  . j ava  2  s.c o  m*/
    out.writeUTF(getBucketName());
    out.writeObject(getAcl());
    out.writeBoolean(isMetadataComplete());
    out.writeObject(getMetadataMap());
    ByteArrayOutputStream buffer = new ByteArrayOutputStream();
    try {
        IOUtils.copy(this.getDataInputStream(), buffer);
    } catch (S3ServiceException e) {
        LOG.error("Error copying entity stream", e);
        throw new IOException("Error serializing object", e);
    }
    out.writeInt(buffer.toByteArray().length);
    out.write(buffer.toByteArray());
}