Examples of writeFloat()


Examples of org.apache.activemq.command.ActiveMQBytesMessage.writeFloat()

    }

    public void testReadFloat() {
        ActiveMQBytesMessage msg = new ActiveMQBytesMessage();
        try {
            msg.writeFloat(3.3f);
            msg.reset();
            assertTrue(msg.readFloat() == 3.3f);
        } catch (JMSException jmsEx) {
            jmsEx.printStackTrace();
            assertTrue(false);
View Full Code Here

Examples of org.apache.activemq.command.ActiveMQStreamMessage.writeFloat()

    public void testReadFloat() {
        ActiveMQStreamMessage msg = new ActiveMQStreamMessage();
        try {
            float test = 4.4f;
            msg.writeFloat(test);
            msg.reset();
            assertTrue(msg.readFloat() == test);
            msg.reset();
            assertTrue(msg.readDouble() == test);
            msg.reset();
View Full Code Here

Examples of org.apache.avro.io.Encoder.writeFloat()

  @Test
  public void testReadEncoderOutput() throws Exception {
    ByteArrayOutputStream byteOutputStream = new ByteArrayOutputStream();
    Encoder encoder = new ColumnEncoder(byteOutputStream);
    encoder.writeFloat(1.1f);
    encoder.flush();
    InputStream in = new ByteArrayInputStream(byteOutputStream.toByteArray());
    Decoder decoder = new ColumnDecoder(in);
    float readFloat = decoder.readFloat();
    assertEquals(1.1f, readFloat, 0.0001);
View Full Code Here

Examples of org.apache.hadoop.fs.FSDataOutputStream.writeFloat()

  public void serialize(Path output, Configuration conf) throws IOException {
    FileSystem fs = output.getFileSystem(conf);
    FSDataOutputStream out = fs.create(new Path(output, "naiveBayesModel.bin"));
    try {
      out.writeFloat(alphaI);
      VectorWritable.writeVector(out, weightsPerFeature);
      VectorWritable.writeVector(out, weightsPerLabel);
      VectorWritable.writeVector(out, perlabelThetaNormalizer);
      for (int row = 0; row < weightsPerLabelAndFeature.numRows(); row++) {
        VectorWritable.writeVector(out, weightsPerLabelAndFeature.viewRow(row));
View Full Code Here

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

    public void testEOFFloat() throws Exception
    {
        try
        {
            JMSBytesMessage bm = TestMessageHelper.newJMSBytesMessage();
            bm.writeFloat(1.3f);
            bm.reset();
            bm.readFloat();
            // should throw
            bm.readFloat();
            fail("expected exception did not occur");
View Full Code Here

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

    public void testEOFFloat() throws Exception
    {
        try
        {
            JMSStreamMessage bm = TestMessageHelper.newJMSStreamMessage();
            bm.writeFloat(1.3f);
            bm.reset();
            bm.readFloat();
            // should throw
            bm.readFloat();
            fail("expected exception did not occur");
View Full Code Here

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

    }
  }
  public void testReadFloat() {
    ActiveMQBytesMessage msg = new ActiveMQBytesMessage();
    try {
      msg.writeFloat(3.3f);
      msg.reset();
      assertTrue(msg.readFloat() == 3.3f);
    } catch (JMSException jmsEx) {
      jmsEx.printStackTrace();
      assertTrue(false);
View Full Code Here

Examples of org.codehaus.activemq.message.ActiveMQStreamMessage.writeFloat()

  public void testReadFloat()
  {
    ActiveMQStreamMessage msg = new ActiveMQStreamMessage();
    try {
      float test = 4.4f;
      msg.writeFloat(test);
      msg.reset();
      assertTrue(msg.readFloat()==test);
      msg.reset();
      assertTrue(msg.readDouble()==test);
      msg.reset();
View Full Code Here

Examples of org.elasticsearch.common.io.stream.BytesStreamOutput.writeFloat()

        out.writeShort((short) -1);
        out.writeInt(-1);
        out.writeVInt(2);
        out.writeLong(-3);
        out.writeVLong(4);
        out.writeFloat(1.1f);
        out.writeDouble(2.2);
        out.writeUTF("hello");
        out.writeUTF("goodbye");

        BytesStreamInput in = new BytesStreamInput(out.copiedByteArray());
View Full Code Here

Examples of org.hornetq.api.core.HornetQBuffer.writeFloat()

      float f1 = RandomUtil.randomFloat();

      dynamic.writeUTF(str1);
      dynamic.writeString(str2);
      dynamic.writeDouble(d1);
      dynamic.writeFloat(f1);

      LargeMessageControllerImpl readBuffer = splitBuffer(3, dynamic.toByteBuffer().array());

      Assert.assertEquals(str1, readBuffer.readUTF());
      Assert.assertEquals(str2, readBuffer.readString());
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.