Examples of readBytes()


Examples of org.apache.qpid.transport.codec.BBDecoder.readBytes()

    void updateInstanceWithConfigurationData(QpidManagedObject instance,byte [] rawData)
    {
        BBDecoder decoder = new BBDecoder();
        decoder.init(ByteBuffer.wrap(rawData));

        byte [] presenceBitMasks = decoder.readBytes(_howManyPresenceBitMasks);
        for (QpidProperty property : _schemaOrderedProperties)
        {                 
            try {
                Object value = property.decodeValue(decoder,presenceBitMasks);
                instance.createOrReplaceAttributeValue(property.getName(),value);            
View Full Code Here

Examples of org.apache.qpid.transport.codec.Decoder.readBytes()

            replyTo = message.getJMSReplyTo();
        } catch (JMSException e)
        {
            throw new AgentException(e);
        }
        byte[] magic = dec.readBytes(3);
        if (magic[0] != 'A' || magic[1] != 'M' || magic[2] != '2')
        {
            throw new AgentException("bad magic: " + new String(magic));
        }
        short op = dec.readUint8();
View Full Code Here

Examples of org.codehaus.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.codehaus.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

Examples of org.elasticsearch.common.io.stream.StreamInput.readBytes()

        byte[] origBuf = new byte[length];
        getRandom().nextBytes(origBuf);
        byte[] targetBuf = Arrays.copyOf(origBuf, origBuf.length);

        // bulk-read 0 bytes: must not modify buffer
        si.readBytes(targetBuf, 0, 0);
        assertEquals(origBuf[0], targetBuf[0]);
        si.reset();

        // read a few few bytes as ints
        int bytesToRead = randomIntBetween(1, length / 2);
View Full Code Here

Examples of org.gephi.project.spi.WorkspaceBytesPersistenceProvider.readBytes()

        if (provider != null) {
            DataInputStream stream = null;
            try {
                stream = new DataInputStream(inputstream);
                provider.readBytes(stream, workspace);
            } finally {
                if (stream != null) {
                    stream.close();
                }
            }
View Full Code Here

Examples of org.gradle.messaging.serialize.kryo.KryoBackedDecoder.readBytes()

                        continue;
                    }

                    if (testId == 0 || testId == readTestId) {
                        byte[] stringBytes = new byte[readLength];
                        decoder.readBytes(stringBytes);
                        String message;
                        try {
                            message = new String(stringBytes, messageStorageCharset.name());
                        } catch (UnsupportedEncodingException e) {
                            // shouldn't happen
View Full Code Here

Examples of org.h2.value.Transfer.readBytes()

                done(transfer);
                length = transfer.readInt();
                if (length <= 0) {
                    return length;
                }
                transfer.readBytes(buff, off, length);
                return length;
            } catch (IOException e) {
                removeServer(e, i--, ++count);
            }
        }
View Full Code Here

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

      currentLargeMessageController.setLocal(true);

      //sets the packet
      HornetQBuffer qbuff = clMessage.getBodyBuffer();
      int bytesToRead = qbuff.writerIndex() - qbuff.readerIndex();
      final byte[] body = qbuff.readBytes(bytesToRead).toByteBuffer().array();

      largeMessage.setLargeMessageController(new CompressedLargeMessageControllerImpl(currentLargeMessageController));
      SessionReceiveContinuationMessage packet = new SessionReceiveContinuationMessage(this.getID(), body, false, false, body.length);
      currentLargeMessageController.addPacket(packet);
View Full Code Here

Examples of org.hornetq.core.client.impl.LargeMessageBufferImpl.readBytes()

      final LargeMessageBufferImpl buffer = new LargeMessageBufferImpl(new FakeConsumerInternal(), 10, 10);

      buffer.addPacket(new FakePacket(-1, new byte[] { 0, 1, 2, 3, 4 }, true, true));

      byte bytes[] = new byte[30];
      buffer.readBytes(bytes, 0, 5);

      for (byte i = 0; i < 5; i++)
      {
         Assert.assertEquals(i, bytes[i]);
      }
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.