Example usage for java.io ObjectOutput writeUTF

List of usage examples for java.io ObjectOutput writeUTF

Introduction

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

Prototype

void writeUTF(String s) throws IOException;

Source Link

Document

Writes two bytes of length information to the output stream, followed by the modified UTF-8 representation of every character in the string s.

Usage

From source file:com.sentaroh.android.TextFileBrowser.ViewedFileListAdapter.java

@Override
public void writeExternal(ObjectOutput out) throws IOException {
    out.writeUTF(file_path);
    out.writeUTF(file_name);//www .j  a v  a2  s  .  c om
    out.writeInt(listViewPos[0]);
    out.writeInt(listViewPos[1]);
    out.writeInt(copyFrom);
    out.writeInt(copyTo);
    out.writeInt(horizontalPos);
    out.writeInt(findResultPos);
    out.writeBoolean(findPosIsValid);
    out.writeBoolean(searchEnabled);
    out.writeUTF(searchString);
    out.writeBoolean(searchCaseSensitive);

    out.writeInt(lineBreak);
    out.writeInt(browseMode);
    out.writeBoolean(showLineNo);

    out.writeUTF(encodeName);
    out.writeBoolean(viewerParmsInitRequired);
    out.writeBoolean(viewerParmsRestoreRequired);
}

From source file:com.splicemachine.pipeline.constraint.ConstraintContext.java

@Override
public void writeExternal(ObjectOutput objectOutput) throws IOException {
    short len = (short) (messageArgs == null ? 0 : messageArgs.length);
    objectOutput.writeShort(len);//w  w  w  .ja  v a  2 s  .  c om
    for (int i = 0; i < len; i++) {
        objectOutput.writeUTF(messageArgs[i]);
    }
}

From source file:org.ihtsdo.otf.tcc.ddo.TimeReference.java

@Override
public void writeExternal(ObjectOutput out) throws IOException {
    out.writeLong(getTime());/*from   w  ww  . j  a  v  a  2 s  . c o m*/

    if ((formatterProperty != null) || (formatter != null)) {
        out.writeBoolean(true);
        out.writeUTF(getFormatter().getPattern());
    } else {
        out.writeBoolean(false);
    }
}

From source file:org.openspaces.remoting.ExecutorRemotingTask.java

public void writeExternal(ObjectOutput out) throws IOException {
    out.writeUTF(lookupName);
    out.writeUTF(methodName);//from  w ww. j av a2  s.  c o m
    if (arguments == null) {
        out.writeInt(0);
    } else {
        out.writeInt(arguments.length);
        for (Object arg : arguments) {
            out.writeObject(arg);
        }
    }
    if (metaArguments == null) {
        out.writeInt(0);
    } else {
        out.writeInt(metaArguments.length);
        for (Object arg : metaArguments) {
            out.writeObject(arg);
        }
    }

    methodHash.writeExternal(out);
}

From source file:org.shredzone.flattr4j.connector.FlattrObject.java

@Override
public void writeExternal(ObjectOutput out) throws IOException {
    out.writeUTF(data.toString());
}

From source file:org.knime.al.util.noveltydetection.knfst.KNFST.java

@Override
public void writeExternal(final ObjectOutput arg0) throws IOException {
    // write kernel
    arg0.writeUTF(m_kernel.getClass().getName());
    m_kernel.writeExternal(arg0);/*from   www.  j av a  2  s . c o m*/

    // write projection
    // rows
    arg0.writeInt(m_projection.getRowDimension());
    // columns
    arg0.writeInt(m_projection.getColumnDimension());
    // data
    final double[][] projData = m_projection.getData();
    for (final double[] row : projData) {
        for (final double cell : row) {
            arg0.writeDouble(cell);
        }
    }

    // write targetPoints
    // rows
    arg0.writeInt(m_targetPoints.getRowDimension());
    // columns
    arg0.writeInt(m_targetPoints.getColumnDimension());
    // data
    final double[][] tarData = m_targetPoints.getData();
    for (final double[] row : tarData) {
        for (final double cell : row) {
            arg0.writeDouble(cell);
        }
    }

    // write betweenClassDistances
    // length
    arg0.writeInt(m_betweenClassDistances.length);
    // data
    for (final double dist : m_betweenClassDistances) {
        arg0.writeDouble(dist);
    }
}

From source file:org.knime.al.util.noveltydetection.knfst.MultiClassKNFST.java

@Override
public void writeExternal(final ObjectOutput arg0) throws IOException {
    // call super method
    super.writeExternal(arg0);

    // write labels
    arg0.writeInt(m_labels.length);//w  ww  .  j  a v a2 s .  co  m
    for (final String label : m_labels) {
        arg0.writeUTF(label);
    }

}

From source file:org.knime.al.util.noveltydetection.kernel.KernelCalculator.java

@Override
public void writeExternal(final ObjectOutput out) throws IOException {
    // write kernelFunction
    out.writeUTF(m_kernelFunction.getClass().getName());
    m_kernelFunction.writeExternal(out);

    // write trainingData
    // rows/*from   w  ww.j a  va  2s  . c om*/
    out.writeInt(m_rowCount);
    // columns
    out.writeInt(m_colCount);
    // data
    for (final double[] row : m_trainingData) {
        for (final double col : row) {
            out.writeDouble(col);
        }
    }

}

From source file:org.apache.ode.utils.NSContext.java

/**
 * @see Externalizable#writeExternal(java.io.ObjectOutput)
 *///from   w  ww. ja v  a 2s . c o  m
public void writeExternal(ObjectOutput out) throws IOException {
    if (__log.isTraceEnabled()) {
        __log.trace("writeExternal: contents=" + _prefixToUriMap);
    }

    out.writeInt(_prefixToUriMap.size());

    for (Iterator i = _prefixToUriMap.entrySet().iterator(); i.hasNext();) {
        Map.Entry me = (Map.Entry) i.next();
        out.writeUTF((String) me.getKey());
        out.writeUTF((String) me.getValue());
    }
}

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

@Override
public void writeExternal(ObjectOutput out) throws IOException {
    try {//from www .j a  v  a2  s .  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);
    }

}