Examples of readFields()


Examples of com.urbanairship.datacube.backfill.CollectionWritable.readFields()

        byte[] rawBytes = Base64.decodeBase64(base64.getBytes());
        DataInputBuffer in = new DataInputBuffer();
        in.reset(rawBytes, rawBytes.length);
       
        CollectionWritable cw = new CollectionWritable();
        cw.readFields(in);
        return (Collection<T>)cw.getCollection();
    }
   
    @Override
    public RecordReader<Writable, NullWritable> createRecordReader(final InputSplit split, TaskAttemptContext arg1)
View Full Code Here

Examples of de.jungblut.writable.MatrixWritable.readFields()

   * stream. Note that "in" will not be closed by this method.
   */
  public static MultinomialNaiveBayes deserialize(DataInput in)
      throws IOException {
    MatrixWritable matrixWritable = new MatrixWritable();
    matrixWritable.readFields(in);
    DoubleVector classProbability = VectorWritable.readVector(in);

    return new MultinomialNaiveBayes(matrixWritable.getMatrix(),
        classProbability);
  }
View Full Code Here

Examples of dmt.tools.CSVFileReader.readFields()

    CSVFileWriter out = new CSVFileWriter(outCSV, ',');
   
    //adding headers
    out.writeFields(getHeaders());

      Vector<String> fields = in.readFields();
      int k=0;
     
      while(fields!=null)
      {
        //update the hashMap
View Full Code Here

Examples of edu.umd.cloud9.io.pair.PairOfFloatInt.readFields()

    origPair.write(dataOut);

    PairOfFloatInt pair = new PairOfFloatInt();

    pair.readFields(new DataInputStream(new ByteArrayInputStream(bytesOut.toByteArray())));

    assertTrue(pair.getLeftElement() == 3.14f);
    assertEquals(pair.getRightElement(), 2);
  }
View Full Code Here

Examples of edu.umd.cloud9.io.pair.PairOfFloatString.readFields()

    origPair.write(dataOut);

    PairOfFloatString pair = new PairOfFloatString();

    pair.readFields(new DataInputStream(new ByteArrayInputStream(bytesOut.toByteArray())));

    assertEquals("hi", pair.getRightElement());
    assertTrue(pair.getLeftElement() == 2.0f);
  }
View Full Code Here

Examples of edu.umd.cloud9.io.pair.PairOfFloats.readFields()

    origPair.write(dataOut);

    PairOfFloats pair = new PairOfFloats();

    pair.readFields(new DataInputStream(new ByteArrayInputStream(bytesOut.toByteArray())));

    assertTrue(pair.getLeftElement() == 3.14f);
    assertTrue(pair.getRightElement() == 2.0f);
  }
View Full Code Here

Examples of edu.umd.cloud9.io.pair.PairOfIntFloat.readFields()

    origPair.write(dataOut);

    PairOfIntFloat pair = new PairOfIntFloat();

    pair.readFields(new DataInputStream(new ByteArrayInputStream(bytesOut.toByteArray())));

    assertEquals(1.0f, pair.getLeftElement(), 10e-6);
    assertEquals(2.0f, pair.getRightElement(), 10e-6);
  }
View Full Code Here

Examples of edu.umd.cloud9.io.pair.PairOfIntLong.readFields()

    origPair.write(dataOut);

    PairOfIntLong pair = new PairOfIntLong();

    pair.readFields(new DataInputStream(new ByteArrayInputStream(bytesOut.toByteArray())));

    assertEquals(1L, pair.getLeftElement());
    assertEquals(2L, pair.getRightElement());
  }
View Full Code Here

Examples of edu.umd.cloud9.io.pair.PairOfIntString.readFields()

    origPair.write(dataOut);

    PairOfIntString pair = new PairOfIntString();

    pair.readFields(new DataInputStream(new ByteArrayInputStream(bytesOut.toByteArray())));

    assertEquals(1, pair.getLeftElement());
    assertEquals("2", pair.getRightElement());
  }
View Full Code Here

Examples of edu.umd.cloud9.io.pair.PairOfInts.readFields()

  public void readFields(DataInput in) throws IOException{
    int size = in.readInt();
    for(int i=0; i<size; i++){
      PairOfInts elt = new PairOfInts();
      elt.readFields(in);
      lst.add(elt);
    }
  }

  public void write(DataOutput out) throws IOException {
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.