Examples of readDouble()


Examples of org.apache.avro.io.Decoder.readDouble()

    encoder = new ColumnEncoder(byteOutputStream);
    encoder.writeDouble(1.1d);
    encoder.flush();
    in = new ByteArrayInputStream(byteOutputStream.toByteArray());
    decoder = new ColumnDecoder(in);
    double readDouble = decoder.readDouble();
    assertEquals(1.1d, readDouble, 0.0001);

    byteOutputStream = new ByteArrayOutputStream();
    encoder = new ColumnEncoder(byteOutputStream);
    encoder.writeString("hello there");
View Full Code Here

Examples of org.apache.blur.thirdparty.thrift_0_9_0.protocol.TTupleProtocol.readDouble()

          for (int _i195 = 0; _i195 < _map194.size; ++_i195)
          {
            String _key196; // required
            double _val197; // optional
            _key196 = iprot.readString();
            _val197 = iprot.readDouble();
            struct.doubleMap.put(_key196, _val197);
          }
        }
        struct.setDoubleMapIsSet(true);
      }
View Full Code Here

Examples of org.apache.hadoop.fs.FSDataInputStream.readDouble()

    fop.close();

    // Let's check we can read it when everybody's there
    long start = System.currentTimeMillis();
    FSDataInputStream fin = dfs.open(p);
    Assert.assertTrue(toWrite == fin.readDouble());
    long end = System.currentTimeMillis();
    LOG.info("readtime= " + (end - start));
    fin.close();
    Assert.assertTrue((end - start) < 30 * 1000);

 
View Full Code Here

Examples of org.apache.hadoop.hive.serde2.thrift.TCTLSeparatedProtocol.readDouble()

    // let's see if doubles work ok
    prot.readFieldBegin();
    TList l = prot.readListBegin();
    assertTrue(l.size == 2);
    assertTrue(prot.readDouble() == 348.55);
    assertTrue(prot.readDouble() == 234.22);
    prot.readListEnd();
    prot.readFieldEnd();

    // nice message
View Full Code Here

Examples of org.apache.qpid.client.message.JMSBytesMessage.readDouble()

        try
        {
            JMSBytesMessage bm = TestMessageHelper.newJMSBytesMessage();
            bm.writeDouble(1.3d);
            bm.reset();
            bm.readDouble();
            // should throw
            bm.readDouble();
            fail("expected exception did not occur");
        }
        catch (MessageEOFException m)
View Full Code Here

Examples of org.apache.qpid.client.message.JMSStreamMessage.readDouble()

        assertEquals((short) 29, bm.readShort());
        assertEquals(101, bm.readInt());
        assertEquals(50003222L, bm.readLong());
        assertEquals("Foobar", bm.readString());
        assertEquals(1.7f, bm.readFloat());
        assertEquals(8.7d, bm.readDouble());
    }

    public void testWriteObjectRejectsNonPrimitives() throws Exception
    {
        try
View Full Code Here

Examples of org.apache.qpid.proton.TestDecoder.readDouble()

        assertEquals(12345, d.readUnsignedInteger().intValue());
        assertEquals(-12345, d.readInteger().intValue());
        assertEquals(12345, d.readUnsignedLong().longValue());
        assertEquals(-12345, d.readLong().longValue());
        assertEquals(0.125, d.readFloat().floatValue(), 0e-10);
        assertEquals(0.125, d.readDouble().doubleValue(), 0e-10);
    }

    @Test
    public void testStrings() throws IOException
    {
View Full Code Here

Examples of org.apache.thrift.protocol.TProtocol.readDouble()

   
  public static void testDouble() throws Exception {
    TMemoryBuffer buf = new TMemoryBuffer(1000);
    TProtocol proto = factory.getProtocol(buf);
    proto.writeDouble(123.456);
    double out = proto.readDouble();
    if (out != 123.456) {
      throw new RuntimeException("Double was supposed to be " + 123.456 + " but was " + out);
    }
  }
   
View Full Code Here

Examples of org.apache.thrift.protocol.TTupleProtocol.readDouble()

      if (incoming.get(4)) {
        struct.numEntries = iprot.readI64();
        struct.setNumEntriesIsSet(true);
      }
      if (incoming.get(5)) {
        struct.ingestRate = iprot.readDouble();
        struct.setIngestRateIsSet(true);
      }
      if (incoming.get(6)) {
        struct.queryRate = iprot.readDouble();
        struct.setQueryRateIsSet(true);
View Full Code Here

Examples of org.codehaus.activemq.message.ActiveMQBytesMessage.readDouble()

  public void testReadDouble() {
    ActiveMQBytesMessage msg = new ActiveMQBytesMessage();
    try {
      msg.writeDouble(3.3d);
      msg.reset();
      assertTrue(msg.readDouble() == 3.3d);
    } catch (JMSException jmsEx) {
      jmsEx.printStackTrace();
      assertTrue(false);
    }
  }
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.