Examples of buffer()


Examples of net.tomp2p.message.Buffer.buffer()

   */
  public void handleBufferResponse(Message bufferResponse, FutureDone<Void> futureDone) {
    Buffer buffer = bufferResponse.buffer(0);
    if (buffer != null) {
      // decompose the large buffer into a buffer for each message
      List<Message> bufferedMessages = RelayUtils.decomposeCompositeBuffer(buffer.buffer(), bufferResponse.recipientSocket(),
          bufferResponse.senderSocket(), peer.connectionBean().channelServer().channelServerConfiguration().signatureFactory());
      LOG.debug("Received {} buffered messages", bufferedMessages.size());
      for (Message bufferedMessage : bufferedMessages) {
          processMessage(bufferedMessage);
      }
View Full Code Here

Examples of net.tomp2p.message.Message.buffer()

      } else if(!gcmServerCredentials.valid()) {
        LOG.error("GCM Server Configuration is not valid. Please provide a valid configuration");
        return futureDone.failed("Invalid GCM configuration");
      } else {
        // add the registration ID, the GCM authentication key and the map update interval
        message.buffer(RelayUtils.encodeString(gcmServerCredentials.registrationId()));
        message.buffer(RelayUtils.encodeString(gcmServerCredentials.senderAuthenticationKey()));
        message.intValue(mapUpdateInterval);
      }
    }
View Full Code Here

Examples of net.tomp2p.p2p.builder.SendDirectBuilder.buffer()

            if (!wait) {
                ByteBuf replyBuffer = Unpooled.buffer(50);
                replyBuffer.writerIndex(50);
                b.addComponent(replyBuffer);
            }
            sendDirectBuilder.buffer(b);
            sendDirectBuilder.progressListener(new ProgressListener() {
                @Override
                public void progress(final Message interMediateMessage) {
                    if (interMediateMessage.isDone()) {
                        progressComplete.incrementAndGet();
View Full Code Here

Examples of net.tomp2p.storage.Data.buffer()

    FuturePut futurePut = p1.put(lKey).setDomainKey(dKey).setData(cKey, data).setVersionKey(vKey).start();
    futurePut.awaitUninterruptibly();
    Assert.assertTrue(futurePut.isSuccess());

    // create signature with keys 1 having the data object
    byte[] signature1 = factory.sign(keyPair1.getPrivate(), data.buffer()).encode();

    // decrypt signature to get hash of the object
    Cipher rsa = Cipher.getInstance("RSA");
    rsa.init(Cipher.DECRYPT_MODE, keyPair1.getPublic());
    byte[] hash = rsa.doFinal(signature1);
View Full Code Here

Examples of one.nio.util.ByteArrayBuilder.buffer()

        }
        builder.append('\r').append('\n');
        if (includeBody && body != null) {
            builder.append(body);
        }
        return builder.buffer();
    }

    @Override
    public String toString() {
        return Utf8.toString(toBytes(true));
View Full Code Here

Examples of org.agilewiki.jactor2.core.impl.mtReactors.ReactorMtImpl.buffer()

            isolationReactor = (IsolationReactor) targetReactor;
        }
        sourceExceptionHandler = (ExceptionHandler<RESPONSE_TYPE>) source
                .getExceptionHandler();
        final boolean local = targetReactor == source.asReactor();
        if (local || !source.buffer(this, targetReactorImpl)) {
            targetReactorImpl.unbufferedAddMessage(this, local);
        }
    }

    /**
 
View Full Code Here

Examples of org.apache.directory.api.util.ByteBuffer.buffer()

        for ( int ii = 0; ii < 20; ii++ )
        {
            buf.append( ii );
            assertEquals( ii, buf.get( ii ) );
            assertEquals( ii, buf.buffer()[ii] );
        }

        assertEquals( 20, buf.capacity() );
        buf.append( 20 );
        assertEquals( 30, buf.capacity() );
View Full Code Here

Examples of org.apache.directory.shared.util.ByteBuffer.buffer()

       
        for ( int ii = 0; ii < 20; ii++ )
        {
            buf.append( ii );
            assertEquals(ii, buf.get(ii));
            assertEquals(ii, buf.buffer()[ii]);
        }
       
        assertEquals(20, buf.capacity());
        buf.append( 20 );
        assertEquals(30, buf.capacity());
View Full Code Here

Examples of org.apache.drill.exec.memory.BufferAllocator.buffer()

    ByteBuf[] byteBufs = writableBatch.getBuffers();
    int bytes = 0;
    for (int i = 0; i < byteBufs.length; i++) {
      bytes += byteBufs[i].writerIndex();
    }
    ByteBuf byteBuf = allocator.buffer(bytes);
    int index = 0;
    for (int i = 0; i < byteBufs.length; i++) {
      byteBufs[i].readBytes(byteBuf, index, byteBufs[i].writerIndex());
      index += byteBufs[i].writerIndex();
    }
View Full Code Here

Examples of org.apache.drill.exec.memory.DirectBufferAllocator.buffer()

public class TestEndianess {
 
  @Test
  public void testLittleEndian(){
    DirectBufferAllocator a = new DirectBufferAllocator();
    ByteBuf b = a.buffer(4);
    b.setInt(0, 35);
    assertEquals((int) b.getByte(0), 35);
    assertEquals((int) b.getByte(1), 0);
    assertEquals((int) b.getByte(2), 0);
    assertEquals((int) b.getByte(3), 0);
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.