Package edu.umd.cloud9.io.pair

Examples of edu.umd.cloud9.io.pair.PairOfFloats.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


    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

    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

    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

    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

    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

  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

    origPair.write(dataOut);

    PairOfInts pair = new PairOfInts();

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

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

  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

    origPair.write(dataOut);

    PairOfLongFloat pair = new PairOfLongFloat();

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

    assertEquals(1L, pair.getLeftElement());
    assertTrue(pair.getRightElement() == 2.0f);
  }
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.