Example usage for java.io DataOutput writeDouble

List of usage examples for java.io DataOutput writeDouble

Introduction

In this page you can find the example usage for java.io DataOutput writeDouble.

Prototype

void writeDouble(double v) throws IOException;

Source Link

Document

Writes a double value, which is comprised of eight bytes, to the output stream.

Usage

From source file:com.chinamobile.bcbsp.ml.VectorWritable.java

public static void writeVector(DoubleVector vector, DataOutput out) throws IOException {
    if (vector == null) {
        LOG.info("lin test : VectorWritable write Vector is null");
    } else {//from  w w  w . j a va  2 s . c  o  m
        LOG.info("lin test : VectorWritable write Vector is not null");
    }
    out.writeInt(vector.getLength());
    for (int i = 0; i < vector.getDimension(); i++) {
        out.writeDouble(vector.get(i));
    }

    if (vector.isNamed() && vector.getName() != null) {
        out.writeBoolean(true);
        out.writeUTF(vector.getName());
    } else {
        out.writeBoolean(false);
    }
}

From source file:RandomFileTest.java

public void writeData(DataOutput out) throws IOException {
    DataIO.writeFixedString(name, NAME_SIZE, out);
    out.writeDouble(salary);
}

From source file:inflater.datatypes.writable.CoordinateWritable.java

@Override
public void write(DataOutput out) throws IOException {
    out.writeDouble(coordinate.x);
    out.writeDouble(coordinate.y);//from w w  w . j a  v  a 2s. co  m
    out.writeDouble(coordinate.z);
}

From source file:eu.stratosphere.nephele.streaming.message.qosreport.VertexLatency.java

/**
 * {@inheritDoc}/*from   www.j  a va2  s .co  m*/
 */
@Override
public void write(final DataOutput out) throws IOException {
    this.reporterID.write(out);
    out.writeDouble(this.getVertexLatency());
}

From source file:RandomFileTest.java

/**
   Writes employee data to a data output
   @param out the data output/*from  ww w  .java  2s  .  c  om*/
*/
public void writeData(DataOutput out) throws IOException {
    DataIO.writeFixedString(name, NAME_SIZE, out);
    out.writeDouble(salary);

    GregorianCalendar calendar = new GregorianCalendar();
    calendar.setTime(hireDay);
    out.writeInt(calendar.get(Calendar.YEAR));
    out.writeInt(calendar.get(Calendar.MONTH) + 1);
    out.writeInt(calendar.get(Calendar.DAY_OF_MONTH));
}

From source file:org.springdata.ehcache.core.Book.java

@Override
public void write(DataOutput out) throws IOException {
    out.writeLong(id);/*from w ww.j av  a2s  .  co  m*/
    out.writeUTF(author);
    out.writeDouble(price);
}

From source file:edu.umn.cs.spatialHadoop.indexing.GridPartitioner.java

@Override
public void write(DataOutput out) throws IOException {
    out.writeDouble(x);
    out.writeDouble(y);/*  ww  w.  ja  v a 2 s .  co  m*/
    out.writeDouble(tileWidth);
    out.writeDouble(tileHeight);
    out.writeInt(numTiles);
}

From source file:eu.stratosphere.nephele.streaming.message.qosreport.EdgeLatency.java

/**
 * {@inheritDoc}//from   ww  w  .j a  v a  2s  . co m
 */
@Override
public void write(final DataOutput out) throws IOException {
    this.reporterID.write(out);
    out.writeDouble(this.getEdgeLatency());
}

From source file:edu.umn.cs.spatialHadoop.osm.OSMEdge.java

@Override
public void write(DataOutput out) throws IOException {
    out.writeLong(edgeId);/*from   www .  j a  v  a  2 s .  c o m*/
    out.writeLong(nodeId1);
    out.writeDouble(lat1);
    out.writeDouble(lon1);
    out.writeLong(nodeId2);
    out.writeDouble(lat2);
    out.writeDouble(lon2);
    out.writeLong(wayId);
    out.writeUTF(tags);
}

From source file:hip.ch3.seqfile.writable.StockPriceWritable.java

@Override
public void write(DataOutput out) throws IOException {
    WritableUtils.writeString(out, symbol);
    WritableUtils.writeString(out, date);
    out.writeDouble(open);
    out.writeDouble(high);//from ww  w.ja  va 2  s .c o  m
    out.writeDouble(low);
    out.writeDouble(close);
    out.writeInt(volume);
    out.writeDouble(adjClose);

}