akka.protobuf.ByteString.newCodedInput()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(6.8k)|赞(0)|评价(0)|浏览(101)

本文整理了Java中akka.protobuf.ByteString.newCodedInput()方法的一些代码示例,展示了ByteString.newCodedInput()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ByteString.newCodedInput()方法的具体详情如下:
包路径:akka.protobuf.ByteString
类名称:ByteString
方法名:newCodedInput

ByteString.newCodedInput介绍

[英]Creates a CodedInputStream which can be used to read the bytes. Using this is often more efficient than creating a CodedInputStreamthat wraps the result of #newInput().
[中]创建可用于读取字节的CodedInputStream。使用此选项通常比创建封装#newInput()结果的CodedInputStream更有效。

代码示例

代码示例来源:origin: com.typesafe.akka/akka-protobuf_2.12

public BuilderType mergeFrom(final ByteString data)
  throws InvalidProtocolBufferException {
 try {
  final CodedInputStream input = data.newCodedInput();
  mergeFrom(input);
  input.checkLastTagWas(0);
  return (BuilderType) this;
 } catch (InvalidProtocolBufferException e) {
  throw e;
 } catch (IOException e) {
  throw new RuntimeException(
   "Reading from a ByteString threw an IOException (should " +
   "never happen).", e);
 }
}

代码示例来源:origin: com.typesafe.akka/akka-protobuf

public BuilderType mergeFrom(final ByteString data)
  throws InvalidProtocolBufferException {
 try {
  final CodedInputStream input = data.newCodedInput();
  mergeFrom(input);
  input.checkLastTagWas(0);
  return (BuilderType) this;
 } catch (InvalidProtocolBufferException e) {
  throw e;
 } catch (IOException e) {
  throw new RuntimeException(
   "Reading from a ByteString threw an IOException (should " +
   "never happen).", e);
 }
}

代码示例来源:origin: com.typesafe.akka/akka-protobuf_2.11

public BuilderType mergeFrom(final ByteString data)
  throws InvalidProtocolBufferException {
 try {
  final CodedInputStream input = data.newCodedInput();
  mergeFrom(input);
  input.checkLastTagWas(0);
  return (BuilderType) this;
 } catch (InvalidProtocolBufferException e) {
  throw e;
 } catch (IOException e) {
  throw new RuntimeException(
   "Reading from a ByteString threw an IOException (should " +
   "never happen).", e);
 }
}

代码示例来源:origin: com.typesafe.akka/akka-protobuf_2.12

public BuilderType mergeFrom(
  final ByteString data,
  final ExtensionRegistryLite extensionRegistry)
  throws InvalidProtocolBufferException {
 try {
  final CodedInputStream input = data.newCodedInput();
  mergeFrom(input, extensionRegistry);
  input.checkLastTagWas(0);
  return (BuilderType) this;
 } catch (InvalidProtocolBufferException e) {
  throw e;
 } catch (IOException e) {
  throw new RuntimeException(
   "Reading from a ByteString threw an IOException (should " +
   "never happen).", e);
 }
}

代码示例来源:origin: com.typesafe.akka/akka-protobuf

public BuilderType mergeFrom(
  final ByteString data,
  final ExtensionRegistryLite extensionRegistry)
  throws InvalidProtocolBufferException {
 try {
  final CodedInputStream input = data.newCodedInput();
  mergeFrom(input, extensionRegistry);
  input.checkLastTagWas(0);
  return (BuilderType) this;
 } catch (InvalidProtocolBufferException e) {
  throw e;
 } catch (IOException e) {
  throw new RuntimeException(
   "Reading from a ByteString threw an IOException (should " +
   "never happen).", e);
 }
}

代码示例来源:origin: com.typesafe.akka/akka-protobuf_2.12

/**
 * Parse {@code data} as an {@code UnknownFieldSet} and merge it with the
 * set being built.  This is just a small wrapper around
 * {@link #mergeFrom(CodedInputStream)}.
 */
public Builder mergeFrom(final ByteString data)
  throws InvalidProtocolBufferException {
 try {
  final CodedInputStream input = data.newCodedInput();
  mergeFrom(input);
  input.checkLastTagWas(0);
  return this;
 } catch (final InvalidProtocolBufferException e) {
  throw e;
 } catch (final IOException e) {
  throw new RuntimeException(
   "Reading from a ByteString threw an IOException (should " +
   "never happen).", e);
 }
}

代码示例来源:origin: com.typesafe.akka/akka-protobuf_2.11

public BuilderType mergeFrom(
  final ByteString data,
  final ExtensionRegistryLite extensionRegistry)
  throws InvalidProtocolBufferException {
 try {
  final CodedInputStream input = data.newCodedInput();
  mergeFrom(input, extensionRegistry);
  input.checkLastTagWas(0);
  return (BuilderType) this;
 } catch (InvalidProtocolBufferException e) {
  throw e;
 } catch (IOException e) {
  throw new RuntimeException(
   "Reading from a ByteString threw an IOException (should " +
   "never happen).", e);
 }
}

代码示例来源:origin: com.typesafe.akka/akka-protobuf_2.11

/**
 * Parse {@code data} as an {@code UnknownFieldSet} and merge it with the
 * set being built.  This is just a small wrapper around
 * {@link #mergeFrom(CodedInputStream)}.
 */
public Builder mergeFrom(final ByteString data)
  throws InvalidProtocolBufferException {
 try {
  final CodedInputStream input = data.newCodedInput();
  mergeFrom(input);
  input.checkLastTagWas(0);
  return this;
 } catch (final InvalidProtocolBufferException e) {
  throw e;
 } catch (final IOException e) {
  throw new RuntimeException(
   "Reading from a ByteString threw an IOException (should " +
   "never happen).", e);
 }
}

代码示例来源:origin: com.typesafe.akka/akka-protobuf

/**
 * Parse {@code data} as an {@code UnknownFieldSet} and merge it with the
 * set being built.  This is just a small wrapper around
 * {@link #mergeFrom(CodedInputStream)}.
 */
public Builder mergeFrom(final ByteString data)
  throws InvalidProtocolBufferException {
 try {
  final CodedInputStream input = data.newCodedInput();
  mergeFrom(input);
  input.checkLastTagWas(0);
  return this;
 } catch (final InvalidProtocolBufferException e) {
  throw e;
 } catch (final IOException e) {
  throw new RuntimeException(
   "Reading from a ByteString threw an IOException (should " +
   "never happen).", e);
 }
}

代码示例来源:origin: com.typesafe.akka/akka-protobuf

public MessageType parsePartialFrom(ByteString data,
                  ExtensionRegistryLite extensionRegistry)
 throws InvalidProtocolBufferException {
 MessageType message;
 try {
  CodedInputStream input = data.newCodedInput();
  message = parsePartialFrom(input, extensionRegistry);
  try {
   input.checkLastTagWas(0);
  } catch (InvalidProtocolBufferException e) {
   throw e.setUnfinishedMessage(message);
  }
  return message;
 } catch (InvalidProtocolBufferException e) {
  throw e;
 } catch (IOException e) {
  throw new RuntimeException(
    "Reading from a ByteString threw an IOException (should " +
    "never happen).", e);
 }
}

代码示例来源:origin: com.typesafe.akka/akka-protobuf_2.11

public MessageType parsePartialFrom(ByteString data,
                  ExtensionRegistryLite extensionRegistry)
 throws InvalidProtocolBufferException {
 MessageType message;
 try {
  CodedInputStream input = data.newCodedInput();
  message = parsePartialFrom(input, extensionRegistry);
  try {
   input.checkLastTagWas(0);
  } catch (InvalidProtocolBufferException e) {
   throw e.setUnfinishedMessage(message);
  }
  return message;
 } catch (InvalidProtocolBufferException e) {
  throw e;
 } catch (IOException e) {
  throw new RuntimeException(
    "Reading from a ByteString threw an IOException (should " +
    "never happen).", e);
 }
}

代码示例来源:origin: com.typesafe.akka/akka-protobuf_2.12

public MessageType parsePartialFrom(ByteString data,
                  ExtensionRegistryLite extensionRegistry)
 throws InvalidProtocolBufferException {
 MessageType message;
 try {
  CodedInputStream input = data.newCodedInput();
  message = parsePartialFrom(input, extensionRegistry);
  try {
   input.checkLastTagWas(0);
  } catch (InvalidProtocolBufferException e) {
   throw e.setUnfinishedMessage(message);
  }
  return message;
 } catch (InvalidProtocolBufferException e) {
  throw e;
 } catch (IOException e) {
  throw new RuntimeException(
    "Reading from a ByteString threw an IOException (should " +
    "never happen).", e);
 }
}

相关文章