Examples of writeDelimitedTo()


Examples of com.google.gwt.dev.shell.remoteui.RemoteMessageProto.Message.writeDelimitedTo()

    responseMsgBuilder.setMessageId(receivedRequest.getMessageId());
    responseMsgBuilder.setResponse(response);
    Message responseMsg = responseMsgBuilder.build();

    // Send the response back to the client
    responseMsg.writeDelimitedTo(network.getServerSocket().getOutputStream());

    // Make sure that the response received on the client is identical to
    // the response sent by the server
    assertEquals(responseFuture.get(2, TimeUnit.SECONDS), response);
View Full Code Here

Examples of com.google.gwt.dev.shell.remoteui.RemoteMessageProto.Message.writeDelimitedTo()

    messageBuilder.setMessageType(Message.MessageType.FAILURE);
    messageBuilder.setFailure(failureBuilder);
    Message failureMsg = messageBuilder.build();

    // Send the failure message back to the client
    failureMsg.writeDelimitedTo(network.getServerSocket().getOutputStream());

    // Wait for the response on the client. This should result in a
    // RequestException being thrown.
    try {
      responseFuture.get(2, TimeUnit.SECONDS);
View Full Code Here

Examples of com.google.gwt.dev.shell.remoteui.RemoteMessageProto.Message.writeDelimitedTo()

    Message.Builder clientRequestMsgBuilder = Message.newBuilder();
    clientRequestMsgBuilder.setMessageType(Message.MessageType.REQUEST);
    clientRequestMsgBuilder.setMessageId(25);
    clientRequestMsgBuilder.setRequest(clientRequest);
    Message clientRequestMsg = clientRequestMsgBuilder.build();
    clientRequestMsg.writeDelimitedTo(network.getServerSocket().getOutputStream());

    // Receive the response on the client (which was returned by the
    // RequestProcessor)
    Message receivedResponseMsg = Message.parseDelimitedFrom(network.getServerSocket().getInputStream());
View Full Code Here

Examples of com.google.gwt.dev.shell.remoteui.RemoteMessageProto.Message.writeDelimitedTo()

    Message.Builder clientRequestMsgBuilder = Message.newBuilder();
    clientRequestMsgBuilder.setMessageType(Message.MessageType.REQUEST);
    clientRequestMsgBuilder.setMessageId(25);
    clientRequestMsgBuilder.setRequest(clientRequest);
    Message clientRequestMsg = clientRequestMsgBuilder.build();
    clientRequestMsg.writeDelimitedTo(network.getServerSocket().getOutputStream());

    // Receive the response on the client (which was returned by the
    // RequestProcessor)
    Message receivedResponseMsg = Message.parseDelimitedFrom(network.getServerSocket().getInputStream());
View Full Code Here

Examples of com.google.protobuf.MessageLite.writeDelimitedTo()

   */
  public static final void seriDelimitedOne(Object o, OutputStream output) {
    if (o instanceof MessageLite) {
      MessageLite gen = (MessageLite)o;
      try {
        gen.writeDelimitedTo(output);
      } catch (IOException e) {
        throw new SeriException("Failed to write data to the output stream.", e);
      }
    } else {
      throw new SeriException("Message is not protobuf type: " + o.getClass());
View Full Code Here

Examples of com.google.protobuf.UnittestLite.TestPackedExtensionsLite.writeDelimitedTo()

    normalMessage.writeDelimitedTo(output);

    // Write MessageLite with packed extension fields.
    TestPackedExtensionsLite packedMessage =
        TestUtil.getLitePackedExtensionsSet();
    packedMessage.writeDelimitedTo(output);

    InputStream input = new ByteArrayInputStream(output.toByteArray());
    assertMessageEquals(
        normalMessage,
        normalMessage.getParserForType().parseDelimitedFrom(input));
View Full Code Here

Examples of com.google.protobuf.UnittestLite.TestPackedExtensionsLite.writeDelimitedTo()

    normalMessage.writeDelimitedTo(output);

    // Write MessageLite with packed extension fields.
    TestPackedExtensionsLite packedMessage =
        TestUtil.getLitePackedExtensionsSet();
    packedMessage.writeDelimitedTo(output);

    InputStream input = new ByteArrayInputStream(output.toByteArray());
    assertMessageEquals(
        normalMessage,
        normalMessage.getParserForType().parseDelimitedFrom(input));
View Full Code Here

Examples of com.google.protobuf.UnittestLite.TestPackedExtensionsLite.writeDelimitedTo()

    normalMessage.writeDelimitedTo(output);

    // Write MessageLite with packed extension fields.
    TestPackedExtensionsLite packedMessage =
        TestUtil.getLitePackedExtensionsSet();
    packedMessage.writeDelimitedTo(output);

    InputStream input = new ByteArrayInputStream(output.toByteArray());
    assertMessageEquals(
        normalMessage,
        normalMessage.getParserForType().parseDelimitedFrom(input));
View Full Code Here

Examples of org.apache.hadoop.hdfs.protocol.proto.DataTransferProtos.BlockOpResponseProto.writeDelimitedTo()

     
    BlockOpResponseProto response = BlockOpResponseProto.newBuilder()
      .setStatus(SUCCESS)
      .setReadOpChecksumInfo(ckInfo)
      .build();
    response.writeDelimitedTo(out);
    out.flush();
  }
 

  private void checkAccess(DataOutputStream out, final boolean reply,
View Full Code Here

Examples of org.apache.hadoop.hdfs.protocol.proto.DataTransferProtos.BlockOpResponseProto.writeDelimitedTo()

     
    BlockOpResponseProto response = BlockOpResponseProto.newBuilder()
      .setStatus(SUCCESS)
      .setReadOpChecksumInfo(ckInfo)
      .build();
    response.writeDelimitedTo(out);
    out.flush();
  }
 

  private void checkAccess(OutputStream out, final boolean reply,
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.