Examples of readFromBuffer()


Examples of com.javachat.shared.MessageHolder.readFromBuffer()

            if (end != null) {
                buffer.put(end);
            }
            channel.read(buffer);
            buffer.flip();
            String message = holder.readFromBuffer(buffer);
            if (message != null) {
                retList.add(message);
                holder = null;
                count--;
            }
View Full Code Here

Examples of com.javachat.shared.MessageHolder.readFromBuffer()

                if (holder == null) {
                    // Первое сообщение клиента или предыдущее сообщение полностью вычиталось
                    holder = new MessageHolder(MESSAGE_SIZE_LIMIT, CHARSET_NAME);
                    keyAttach.setHolder(holder);
                }
                String message = holder.readFromBuffer(buffer);
                if (message == null) {
                    // Сообщение еще не вычиталось
                    buffer.clear();
                    return;
                }
View Full Code Here

Examples of io.vertx.core.json.JsonArray.readFromBuffer()

  @Test
  public void testClusterSerializable() {
    jsonArray.add("foo").add(123);
    Buffer buff = jsonArray.writeToBuffer();
    JsonArray deserialized = new JsonArray();
    deserialized.readFromBuffer(buff);
    assertEquals(jsonArray, deserialized);
  }

  @Test
  public void testJsonArrayEquality() {
View Full Code Here

Examples of io.vertx.core.json.JsonObject.readFromBuffer()

  @Test
  public void testClusterSerializable() {
    jsonObject.put("foo", "bar").put("blah", 123);
    Buffer buff = jsonObject.writeToBuffer();
    JsonObject deserialized = new JsonObject();
    deserialized.readFromBuffer(buff);
    assertEquals(jsonObject, deserialized);
  }

  @Test
  public void testNumberEquality() {
View Full Code Here

Examples of net.spy.memcached.ops.Operation.readFromBuffer()

    while(read > 0) {
      getLogger().debug("Read %d bytes", read);
      rbuf.flip();
      while(rbuf.remaining() > 0) {
        assert currentOp != null : "No read operation";
        currentOp.readFromBuffer(rbuf);
        if(currentOp.getState() == OperationState.COMPLETE) {
          getLogger().debug(
              "Completed read op: %s and giving the next %d bytes",
              currentOp, rbuf.remaining());
          Operation op=qa.removeCurrentReadOp();
View Full Code Here

Examples of net.spy.memcached.ops.Operation.readFromBuffer()

      rbuf.flip();
      while(rbuf.remaining() > 0) {
        if(currentOp == null) {
          throw new IllegalStateException("No read operation.");
        }
        currentOp.readFromBuffer(rbuf);
        if(currentOp.getState() == OperationState.COMPLETE) {
          getLogger().debug(
              "Completed read op: %s and giving the next %d bytes",
              currentOp, rbuf.remaining());
          Operation op=qa.removeCurrentReadOp();
View Full Code Here

Examples of net.spy.memcached.ops.Operation.readFromBuffer()

    while(read > 0) {
      getLogger().debug("Read %d bytes", read);
      rbuf.flip();
      while(rbuf.remaining() > 0) {
        assert currentOp != null : "No read operation";
        currentOp.readFromBuffer(rbuf);
        if(currentOp.getState() == OperationState.COMPLETE) {
          getLogger().debug(
              "Completed read op: %s and giving the next %d bytes",
              currentOp, rbuf.remaining());
          Operation op=qa.removeCurrentReadOp();
View Full Code Here

Examples of net.spy.memcached.ops.Operation.readFromBuffer()

      rbuf.flip();
      while(rbuf.remaining() > 0) {
        if(currentOp == null) {
          throw new IllegalStateException("No read operation.");
        }
        currentOp.readFromBuffer(rbuf);
        if(currentOp.getState() == OperationState.COMPLETE) {
          getLogger().debug(
              "Completed read op: %s and giving the next %d bytes",
              currentOp, rbuf.remaining());
          Operation op=qa.removeCurrentReadOp();
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.