Examples of readBytes()


Examples of javax.jms.StreamMessage.readBytes()

         if (streamMsg instanceof XBStreamMessage) {
            long length = ((XBStreamMessage)streamMsg).getBodyLength();
            if (length >= Integer.MAX_VALUE)
               throw new XBException("feature.missing", "Handling of big message not implemented");
            content = new byte[(int)length];
            streamMsg.readBytes(content);
         }
         else
            throw new XBException("feature.missing", "Handling of non XBStreamMessage types not implemented");
      }
      else if (msg instanceof BytesMessage) {
View Full Code Here

Examples of javax.sql.rowset.serial.SQLInputImpl.readBytes()

    public void testReadBytes() throws SQLException {
        byte[] bytes = new byte[] { 1, 2, 3 };
        Object[] attributes = new Object[] { bytes };
        SQLInputImpl impl = new SQLInputImpl(attributes,
                new HashMap<String, Class<?>>());
        assertEquals(bytes, impl.readBytes());

        try {
            impl.readBytes();
            fail("should throw SQLException");
        } catch (SQLException e) {
View Full Code Here

Examples of jssc.SerialPort.readBytes()

    try {
      sp.openPort();
      sp.setParams(baud, dataBits, stopBits, parity);
      sp.purgePort(SerialPort.PURGE_RXCLEAR);
      sp.purgePort(SerialPort.PURGE_TXCLEAR);
      buffer = sp.readBytes(byteCount, timeout);
      log.info("Byte Count: " + byteCount);
      log.info("Value: " + new String(buffer));
    } catch (SerialPortTimeoutException e) {
      throw e;
    } catch (SerialPortException e) {
View Full Code Here

Examples of limelight.io.StreamReader.readBytes()

  }

  private void checkSettingImageDataWith(String imageFile) throws Exception
  {
    StreamReader reader = new StreamReader(TestUtil.fs.inputStream(TestUtil.dataDirPath(imageFile)));
    byte[] bytes = reader.readBytes(100000);

    panel.setData(bytes);

    assertEquals(200, panel.getImage().getHeight(null));
    assertEquals(200, panel.getImage().getWidth(null));
View Full Code Here

Examples of net.minecraft.util.io.netty.buffer.ByteBuf.readBytes()

          byte[] encoded = segment.substring(7).getBytes(Charsets.UTF_8);
          ByteBuf decoded = Base64.decode(Unpooled.wrappedBuffer(encoded));
         
          // Read into a byte array
          byte[] data = new byte[decoded.readableBytes()];
          decoded.readBytes(data);
          this.data = data;
        } else {
          // We will ignore these segments
        }
      }
View Full Code Here

Examples of net.timewalker.ffmq3.common.message.BytesMessageImpl.readBytes()

   
    // Char
    msg = new BytesMessageImpl();
    msg.writeBytes(dummy);
    msg.reset();
    assertEquals(3,msg.readBytes(new byte[3]));
   
    // Int
    msg = new BytesMessageImpl();
    msg.writeBytes(dummy);
    msg.reset();
View Full Code Here

Examples of net.timewalker.ffmq3.common.message.StreamMessageImpl.readBytes()

   
    // Bytes
    msg = new StreamMessageImpl();
    msg.writeLong(123);
    msg.markAsReadOnly();
    try { msg.readBytes(new byte[1]); fail("Should have failed"); } catch (MessageFormatException e) { /* OK */  }
    assertEquals(123,msg.readLong());
  }
 
  public void testFloatConversion() throws Exception
  {
View Full Code Here

Examples of net.tomp2p.storage.AlternativeCompositeByteBuf.readBytes()

          .writerIndex(i + 4);
    }
    cbuf.writeByte(1);

    byte[] me = new byte[len];
    cbuf.readBytes(me);
    cbuf.readByte();

    System.err.println("reader: " + cbuf.readerIndex());
    System.err.println("writer: " + cbuf.writerIndex());
    System.err.println("capacity: " + cbuf.capacity());
View Full Code Here

Examples of org.activemq.message.ActiveMQBytesMessage.readBytes()

        data[i] = (byte) i;
      }
      msg.writeBytes(data);
      msg.reset();
      byte[] test = new byte[data.length];
      msg.readBytes(test);
      for (int i = 0; i < test.length; i++) {
        assertTrue(test[i] == i);
      }
    } catch (JMSException jmsEx) {
      jmsEx.printStackTrace();
View Full Code Here

Examples of org.activemq.message.ActiveMQStreamMessage.readBytes()

        test[i]=(byte)i;
      }
      msg.writeBytes(test);
      msg.reset();
      byte[] valid = new byte[test.length];
      msg.readBytes(valid);
      for(int i = 0; i < valid.length;i++){
        assertTrue(valid[i]==test[i]);
      }
    }catch(JMSException jmsEx){
      jmsEx.printStackTrace();
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.