本文整理了Java中com.google.protobuf.ByteString.copyTo()
方法的一些代码示例,展示了ByteString.copyTo()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ByteString.copyTo()
方法的具体详情如下:
包路径:com.google.protobuf.ByteString
类名称:ByteString
方法名:copyTo
[英]Copies bytes into a buffer at the given offset.
[中]将字节复制到给定偏移量的缓冲区中。
代码示例来源:origin: osmandapp/Osmand
@Override
public void copyTo(ByteBuffer target) {
left.copyTo(target);
right.copyTo(target);
}
代码示例来源:origin: googleapis/google-cloud-java
/**
* Copies the content of this {@code ByteArray} into an existing {@code ByteBuffer}.
*
* @throws java.nio.ReadOnlyBufferException if the target is read-only
* @throws java.nio.BufferOverflowException if the target's {@link ByteBuffer#remaining()} space
* is not large enough to hold the data
*/
public final void copyTo(ByteBuffer target) {
byteString.copyTo(target);
}
代码示例来源:origin: com.google.protobuf/protobuf-java
@Override
public void copyTo(ByteBuffer target) {
left.copyTo(target);
right.copyTo(target);
}
代码示例来源:origin: googleapis/google-cloud-java
/**
* Copies bytes into a ByteBuffer.
*
* @throws java.nio.ReadOnlyBufferException if the target is read-only
* @throws java.nio.BufferOverflowException if the target's remaining() space is not large enough
* to hold the data
*/
public void copyTo(ByteBuffer target) {
byteString.copyTo(target);
}
代码示例来源:origin: osmandapp/Osmand
/**
* Copies bytes into a buffer at the given offset.
*
* @param target buffer to copy into
* @param offset in the target buffer
* @throws IndexOutOfBoundsException if the offset is negative or too large
*/
public void copyTo(byte[] target, int offset) {
copyTo(target, 0, offset, size());
}
代码示例来源:origin: com.google.protobuf/protobuf-java
/**
* Copies bytes into a buffer at the given offset.
*
* @param target buffer to copy into
* @param offset in the target buffer
* @throws IndexOutOfBoundsException if the offset is negative or too large
*/
public void copyTo(byte[] target, int offset) {
copyTo(target, 0, offset, size());
}
代码示例来源:origin: googleapis/google-cloud-java
/**
* Copies the content of this {@code ByteArray} into an array of bytes.
*
* @throws IndexOutOfBoundsException if the target is not large enough to hold the data
*/
public final void copyTo(byte[] target) {
byteString.copyTo(target, 0, 0, length());
}
代码示例来源:origin: googleapis/google-cloud-java
/**
* Copies bytes into a buffer.
*
* @throws IndexOutOfBoundsException if an offset or size is negative or too large
*/
public void copyTo(byte[] target) {
byteString.copyTo(target, 0, 0, getLength());
}
代码示例来源:origin: com.google.protobuf/protobuf-java
/**
* Concatenates two strings by copying data values. This is called in a few
* cases in order to reduce the growth of the number of tree nodes.
*
* @param left string on the left
* @param right string on the right
* @return string formed by copying data bytes
*/
private static ByteString concatenateBytes(ByteString left,
ByteString right) {
int leftSize = left.size();
int rightSize = right.size();
byte[] bytes = new byte[leftSize + rightSize];
left.copyTo(bytes, 0, 0, leftSize);
right.copyTo(bytes, 0, leftSize, rightSize);
return ByteString.wrap(bytes); // Constructor wraps bytes
}
代码示例来源:origin: osmandapp/Osmand
if (limit - position >= length) {
value.copyTo(buffer, offset, position, length);
position += length;
} else {
value.copyTo(buffer, offset, position, bytesWritten);
offset += bytesWritten;
length -= bytesWritten;
value.copyTo(buffer, offset, 0, length);
position = length;
} else {
代码示例来源:origin: osmandapp/Osmand
/**
* Concatenates two strings by copying data values. This is called in a few
* cases in order to reduce the growth of the number of tree nodes.
*
* @param left string on the left
* @param right string on the right
* @return string formed by copying data bytes
*/
private static LiteralByteString concatenateBytes(ByteString left,
ByteString right) {
int leftSize = left.size();
int rightSize = right.size();
byte[] bytes = new byte[leftSize + rightSize];
left.copyTo(bytes, 0, 0, leftSize);
right.copyTo(bytes, 0, leftSize, rightSize);
return new LiteralByteString(bytes); // Constructor wraps bytes
}
代码示例来源:origin: com.google.cloud/google-cloud-datastore
/**
* Copies bytes into a ByteBuffer.
*
* @throws java.nio.ReadOnlyBufferException if the target is read-only
* @throws java.nio.BufferOverflowException if the target's remaining() space is not large enough
* to hold the data
*/
public void copyTo(ByteBuffer target) {
byteString.copyTo(target);
}
代码示例来源:origin: yeriomin/play-store-api
@Override
public void copyTo(ByteBuffer target) {
left.copyTo(target);
right.copyTo(target);
}
代码示例来源:origin: com.google.cloud/google-cloud-core
/**
* Copies the content of this {@code ByteArray} into an existing {@code ByteBuffer}.
*
* @throws java.nio.ReadOnlyBufferException if the target is read-only
* @throws java.nio.BufferOverflowException if the target's {@link ByteBuffer#remaining()} space
* is not large enough to hold the data
*/
public final void copyTo(ByteBuffer target) {
byteString.copyTo(target);
}
代码示例来源:origin: WeAreFairphone/FP2-Launcher
@Override
public void copyTo(ByteBuffer target) {
left.copyTo(target);
right.copyTo(target);
}
代码示例来源:origin: com.google.protobuf/protobuf-lite
@Override
public void copyTo(ByteBuffer target) {
left.copyTo(target);
right.copyTo(target);
}
代码示例来源:origin: com.google.protobuf/protobuf-lite
/**
* Copies bytes into a buffer at the given offset.
*
* @param target buffer to copy into
* @param offset in the target buffer
* @throws IndexOutOfBoundsException if the offset is negative or too large
*/
public void copyTo(byte[] target, int offset) {
copyTo(target, 0, offset, size());
}
代码示例来源:origin: WeAreFairphone/FP2-Launcher
/**
* Copies bytes into a buffer at the given offset.
*
* @param target buffer to copy into
* @param offset in the target buffer
* @throws IndexOutOfBoundsException if the offset is negative or too large
*/
public void copyTo(byte[] target, int offset) {
copyTo(target, 0, offset, size());
}
代码示例来源:origin: com.google.cloud/google-cloud-datastore
/**
* Copies bytes into a buffer.
*
* @throws IndexOutOfBoundsException if an offset or size is negative or too large
*/
public void copyTo(byte[] target) {
byteString.copyTo(target, 0, 0, getLength());
}
代码示例来源:origin: com.google.cloud/google-cloud-core
/**
* Copies the content of this {@code ByteArray} into an array of bytes.
*
* @throws IndexOutOfBoundsException if the target is not large enough to hold the data
*/
public final void copyTo(byte[] target) {
byteString.copyTo(target, 0, 0, length());
}
内容来源于网络,如有侵权,请联系作者删除!