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

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

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

ByteString.writeTo介绍

[英]Writes the complete contents of this byte string to the specified output stream argument.
[中]将此字节字符串的完整内容写入指定的输出流参数。

代码示例

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

@Override
public void writeTo(OutputStream outputStream) throws IOException {
 left.writeTo(outputStream);
 right.writeTo(outputStream);
}

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

@Override
public void writeTo(OutputStream outputStream) throws IOException {
 left.writeTo(outputStream);
 right.writeTo(outputStream);
}

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

@Override
public void writeTo(OutputStream outputStream) throws IOException {
 left.writeTo(outputStream);
 right.writeTo(outputStream);
}

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

/**
 * Writes the complete contents of this byte array output stream to
 * the specified output stream argument.
 *
 * @param out the output stream to which to write the data.
 * @throws IOException  if an I/O error occurs.
 */
public void writeTo(OutputStream out) throws IOException {
 ByteString[] cachedFlushBuffers;
 byte[] cachedBuffer;
 int cachedBufferPos;
 synchronized (this) {
  // Copy the information we need into local variables so as to hold
  // the lock for as short a time as possible.
  cachedFlushBuffers =
    flushedBuffers.toArray(new ByteString[flushedBuffers.size()]);
  cachedBuffer = buffer;
  cachedBufferPos = bufferPos;
 }
 for (ByteString byteString : cachedFlushBuffers) {
  byteString.writeTo(out);
 }
 out.write(copyArray(cachedBuffer, cachedBufferPos));
}

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

/**
 * Writes the complete contents of this byte array output stream to
 * the specified output stream argument.
 *
 * @param out the output stream to which to write the data.
 * @throws IOException  if an I/O error occurs.
 */
public void writeTo(OutputStream out) throws IOException {
 ByteString[] cachedFlushBuffers;
 byte[] cachedBuffer;
 int cachedBufferPos;
 synchronized (this) {
  // Copy the information we need into local variables so as to hold
  // the lock for as short a time as possible.
  cachedFlushBuffers =
    flushedBuffers.toArray(new ByteString[flushedBuffers.size()]);
  cachedBuffer = buffer;
  cachedBufferPos = bufferPos;
 }
 for (ByteString byteString : cachedFlushBuffers) {
  byteString.writeTo(out);
 }
 out.write(copyArray(cachedBuffer, cachedBufferPos));
}

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

/**
 * Writes the complete contents of this byte array output stream to
 * the specified output stream argument.
 *
 * @param out the output stream to which to write the data.
 * @throws IOException  if an I/O error occurs.
 */
public void writeTo(OutputStream out) throws IOException {
 ByteString[] cachedFlushBuffers;
 byte[] cachedBuffer;
 int cachedBufferPos;
 synchronized (this) {
  // Copy the information we need into local variables so as to hold
  // the lock for as short a time as possible.
  cachedFlushBuffers =
    flushedBuffers.toArray(new ByteString[flushedBuffers.size()]);
  cachedBuffer = buffer;
  cachedBufferPos = bufferPos;
 }
 for (ByteString byteString : cachedFlushBuffers) {
  byteString.writeTo(out);
 }
 out.write(copyArray(cachedBuffer, cachedBufferPos));
}

相关文章