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:com.github.naoghuman.cm.model.notes.NotesModel.java

@Override
public void writeExternal(ObjectOutput out) throws IOException {
    out.writeLong(this.getId());
    out.writeLong(this.getMatrixId());
    out.writeLong(this.getGenerationTime());
    out.writeObject(StringEscapeUtils.escapeHtml4(this.getNotes()));
}

From source file:com.aol.advertising.qiao.util.cache.ValueWrapper.java

@Override
public void writeExternal(ObjectOutput out) throws IOException {
    out.writeLong(this.insertionTime);
    out.writeLong(this.lastAccessTime);
    out.writeInt(this.timeout);
    out.writeByte(this.isModified);
    out.writeObject(value);
}

From source file:xbird.util.collections.IndexedSet.java

public void writeExternal(ObjectOutput out) throws IOException {
    final int size = _list.size();
    out.writeInt(size);//from w  ww. j  a v  a 2 s.c om
    if(size > 0) {
        for(int i = 0; i < size; i++) {
            E v = _list.get(i);
            out.writeObject(v);
        }
    }
}

From source file:com.github.naoghuman.abclist.model.LinkMapping.java

@Override
public void writeExternal(ObjectOutput out) throws IOException {
    out.writeLong(this.getId());
    out.writeLong(this.getParentId());
    out.writeObject(this.getParentType().getType());
    out.writeLong(this.getChildId());
    out.writeObject(this.getChildType().getType());
}

From source file:com.splicemachine.derby.stream.output.insert.InsertTableWriterBuilder.java

@Override
public void writeExternal(ObjectOutput out) throws IOException {
    try {// w w  w .  j ava  2s .c o  m
        out.writeBoolean(isUpsert);
        out.writeBoolean(operationContext != null);
        if (operationContext != null)
            out.writeObject(operationContext);
        SIDriver.driver().getOperationFactory().writeTxn(txn, out);
        ArrayUtil.writeIntArray(out, pkCols);
        out.writeUTF(tableVersion);
        ArrayUtil.writeIntArray(out, execRowTypeFormatIds);
        out.writeObject(execRowDefinition);
        out.writeInt(autoIncrementRowLocationArray.length);
        for (int i = 0; i < autoIncrementRowLocationArray.length; i++)
            out.writeObject(autoIncrementRowLocationArray[i]);
        out.writeInt(spliceSequences.length);
        for (int i = 0; i < spliceSequences.length; i++) {
            out.writeObject(spliceSequences[i]);
        }
        out.writeLong(heapConglom);
    } catch (Exception e) {
        throw new IOException(e);
    }

}

From source file:de.pro.dbw.file.reflection.api.ReflectionModel.java

@Override
public void writeExternal(ObjectOutput out) throws IOException {
    out.writeLong(this.getId());
    out.writeObject(this.getReflectionCommentModels());
    out.writeLong(this.getGenerationTime());
    out.writeObject(this.getSource());
    out.writeObject(this.getText());
    out.writeObject(this.getTitle());
}

From source file:org.jfree.data.time.junit.SecondTest.java

/**
 * Serialize an instance, restore it, and check for equality.
 *///from  w  w  w  .  j a  v  a  2 s  .  c  om
public void testSerialization() {
    Second s1 = new Second();
    Second s2 = null;
    try {
        ByteArrayOutputStream buffer = new ByteArrayOutputStream();
        ObjectOutput out = new ObjectOutputStream(buffer);
        out.writeObject(s1);
        out.close();

        ObjectInput in = new ObjectInputStream(new ByteArrayInputStream(buffer.toByteArray()));
        s2 = (Second) in.readObject();
        in.close();
    } catch (Exception e) {
        e.printStackTrace();
    }
    assertEquals(s1, s2);
}

From source file:com.github.naoghuman.cm.model.category.CategoryModel.java

@Override
public void writeExternal(ObjectOutput out) throws IOException {
    out.writeLong(this.getId());
    out.writeLong(this.getMatrixId());
    out.writeLong(this.getGenerationTime());
    out.writeObject(StringEscapeUtils.escapeHtml4(this.getTitle()));
    out.writeObject(StringEscapeUtils.escapeHtml4(this.getDescription()));
}

From source file:xbird.engine.remote.RemoteFocus.java

public void writeExternal(ObjectOutput out) throws IOException {
    out.writeObject(_proxy);
    out.writeInt(_fetchSize);//from w  w  w. ja  v  a  2  s.  c om
    out.writeFloat(_fetchGrow);
    out.writeInt(_fetchWatermark);
    out.writeObject(_fetchMethod);
}

From source file:net.lightbody.bmp.proxy.jetty.http.HashUserRealm.java

public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException {
    out.writeObject(_realmName);
    out.writeObject(_config);//  w ww . ja v  a2  s  .  co  m
}