Examples of readBytes()


Examples of org.agilewiki.jid.ReadableBytes.readBytes()

            return null;
        if (value != null)
            return value;
        ReadableBytes readableBytes = readable();
        skipLen(readableBytes);
        value = readableBytes.readBytes(len);
        return value;
    }

    public Object getObject() throws Exception {
        byte[] bytes = getValue();
View Full Code Here

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

            } catch (JMSException e) {
                rc.put("BodyLength", Long.valueOf(0));
            }
            try {
                byte preview[] = new byte[(int)Math.min(length, 255)];
                m.readBytes(preview);

                // This is whack! Java 1.5 JMX spec does not support primitive
                // arrays!
                // In 1.6 it seems it is supported.. but until then...
                Byte data[] = new Byte[preview.length];
View Full Code Here

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

                fail("Should have thrown exception");
            } catch (MessageFormatException mfe) {
            }
            msg.reset();
            try {
                msg.readBytes(new byte[1]);
                fail("Should have thrown exception");
            } catch (MessageFormatException mfe) {
            }
        } catch (JMSException jmsEx) {
            jmsEx.printStackTrace();
View Full Code Here

Examples of org.apache.activemq.command.ActiveMQTextMessage.readBytes()

        } else if (message.getDataStructureType() == ActiveMQBytesMessage.DATA_STRUCTURE_TYPE) {

            ActiveMQBytesMessage msg = (ActiveMQBytesMessage)message.copy();
            msg.setReadOnlyBody(true);
            byte[] data = new byte[(int)msg.getBodyLength()];
            msg.readBytes(data);

            headers.put(Stomp.Headers.CONTENT_LENGTH, Integer.toString(data.length));
            command.setContent(data);
        } else if (message.getDataStructureType() == ActiveMQMessage.DATA_STRUCTURE_TYPE &&
                AdvisorySupport.ADIVSORY_MESSAGE_TYPE.equals(message.getType())) {
View Full Code Here

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

        Schema effectiveSchema = possibleTypes.get(unionIndex);
        if (effectiveSchema.getType() == Type.NULL) {
          decoder.readNull();
          return null;
        } else {
          data = decoder.readBytes(null).array();
        }
      } catch (IOException e) {
        e.printStackTrace();
        throw new GoraException("Error decoding union type: ", e);
      }
View Full Code Here

Examples of org.apache.blur.lucene.fst.ByteArray.readBytes()

    this.blockMask = blockSize - 1;
    long left = numBytes;
    while (left > 0) {
      final int chunk = (int) Math.min(blockSize, left);
      ByteArray block = factory.newByteArray(chunk);
      block.readBytes(in, 0, block.length());
      blocks.add(block);
      left -= chunk;
    }

    // So .getPosition still works
View Full Code Here

Examples of org.apache.cassandra.io.util.MappedFileDataInput.readBytes()

            int indexSize1 = in1.readInt();
            int indexSize2 = in2.readInt();
            assertEquals(indexSize1, indexSize2);

            ByteBuffer bytes1 = in1.readBytes(indexSize1);
            ByteBuffer bytes2 = in2.readBytes(indexSize2);

            assert bytes1.equals(bytes2);

            // cf metadata
            ColumnFamily cf1 = ColumnFamily.create("Keyspace1", "Standard1");
View Full Code Here

Examples of org.apache.directmemory.memory.buffer.MemoryBuffer.readBytes()

        final MemoryBuffer buf = pointer.getMemoryBuffer();
        buf.readerIndex( 0 );

        final byte[] swp = new byte[(int) buf.readableBytes()];
        buf.readBytes( swp );
        return swp;
    }

    @Override
    public Pointer<V> free( final Pointer<V> pointer )
View Full Code Here

Examples of org.apache.lucene.store.ByteArrayDataInput.readBytes()

      int dedup = 0;
      while (reader.read(scratch)) {
        input.reset(scratch.bytes, scratch.offset, scratch.length);
        short analyzedLength = input.readShort();
        analyzed.grow(analyzedLength+2);
        input.readBytes(analyzed.bytes, 0, analyzedLength);
        analyzed.length = analyzedLength;

        long cost = input.readInt();

        surface.bytes = scratch.bytes;
View Full Code Here

Examples of org.apache.lucene.store.DataInput.readBytes()

      while(read < numBytes) {
        if (random().nextInt(10) == 7) {
          verify[read++] = in.readByte();
        } else {
          int chunk = Math.min(random().nextInt(1000), numBytes - read);
          in.readBytes(verify, read, chunk);
          read += chunk;
        }
      }
      assertTrue(Arrays.equals(answer, verify));
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.