Examples of writeBytes()


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

     
      byte[] data = new byte[50];
      for(int i = 0; i < data.length;i++){
        data[i] = (byte)i;
      }
      msg.writeBytes(data);
      msg.reset();
      byte[] valid = (byte[])msg.readObject();
      assertTrue(valid.length==data.length);
      for(int i =0; i < valid.length;i++){
        assertTrue(valid[i]==data[i]);
View Full Code Here

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

    }

    private void flushBuffer() throws IOException {
        try {
            ActiveMQBytesMessage msg = new ActiveMQBytesMessage();
            msg.writeBytes(buffer, 0, count);
            send(msg, false);
        } catch (JMSException e) {
            throw IOExceptionSupport.create(e);
        }
        count = 0;
View Full Code Here

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

        try {
            byte[] test = new byte[50];
            for (int i = 0; i < test.length; i++) {
                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]);
View Full Code Here

Examples of org.apache.derby.impl.io.vfmem.BlockedByteArray.writeBytes()

    public void testLengthNoInitialBlocksWriteMultipleBytes4K() {
        BlockedByteArray src = new BlockedByteArray();
        byte[] buf = new byte[4*1024];
        Arrays.fill(buf, (byte)1);
        src.writeBytes(0, buf, 0, buf.length);
        assertEquals(buf.length, src.length());
        Arrays.fill(buf, (byte)2);
        src.writeBytes(buf.length, buf, 0, buf.length);
        assertEquals(2 * buf.length, src.length());
        src.writeByte(69, (byte)8);
View Full Code Here

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

            }

            p = instanciatePointer( buffer, allocator.getNumber(), expiresIn, NEVER_EXPIRES );

            buffer.writerIndex( 0 );
            buffer.writeBytes( payload );

            used.addAndGet( payload.length );

        }
        while ( p == null );
View Full Code Here

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

  private void createTestData(Path path) throws IOException {
    FileSystem fs = FileSystem.get(getYarnCluster().getConfiguration());
    FSDataOutputStream out = fs.create(path);
    for (int i = 0; i < 300; i++) {
      out.writeBytes("line" + i + "\n");
    }
    out.close();
    assertTrue(fs.exists(path));
    assertThat(fs.getFileStatus(path).getLen(), greaterThan(0l));
  }
View Full Code Here

Examples of org.apache.lucene.store.ByteArrayDataOutput.writeBytes()

         
          output.reset(buffer);

          output.writeShort(analyzedLength);

          output.writeBytes(scratch.bytes, scratch.offset, scratch.length);

          output.writeInt(encodeWeight(iterator.weight()));

          if (hasPayloads) {
            for(int i=0;i<surfaceForm.length;i++) {
View Full Code Here

Examples of org.apache.lucene.store.DataOutput.writeBytes()

      while(written < numBytes) {
        if (random().nextInt(10) == 7) {
          out.writeByte(answer[written++]);
        } else {
          int chunk = Math.min(random().nextInt(1000), numBytes - written);
          out.writeBytes(answer, written, chunk);
          written += chunk;
        }
      }

      final PagedBytes.Reader reader = p.freeze(random.nextBoolean());
View Full Code Here

Examples of org.apache.lucene.store.IndexOutput.writeBytes()

    byte[] b = new byte[1024];
    long remainder = in.length();
    while(remainder > 0) {
      int len = (int) Math.min(b.length, remainder);
      in.readBytes(b, 0, len);
      out.writeBytes(b, len);
      remainder -= len;
    }
    in.close();
    out.close();
  }
View Full Code Here

Examples of org.apache.lucene.store.OutputStream.writeBytes()

                try {
                    long remaining = in.length();
                    while (remaining > 0) {
                        int num = (int) Math.min(remaining, buffer.length);
                        in.readBytes(buffer, 0, num);
                        out.writeBytes(buffer, num);
                        remaining -= num;
                    }
                } finally {
                    out.close();
                }
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.