public final class HBaseZeroCopyByteString
extends com.google.protobuf.ByteString
ByteString without copy.
Without this protobufs would force us to copy every single byte array out of the objects de-serialized from the wire (which already do one copy, on top of the copies the JVM does to go from kernel buffer to C buffer and from C buffer to JVM buffer).
| Modifier and Type | Field and Description |
|---|---|
protected byte[] |
bytes |
| Modifier and Type | Method and Description |
|---|---|
ByteBuffer |
asReadOnlyByteBuffer() |
List<ByteBuffer> |
asReadOnlyByteBufferList() |
byte |
byteAt(int arg0) |
void |
copyTo(ByteBuffer arg0) |
protected void |
copyToInternal(byte[] arg0,
int arg1,
int arg2,
int arg3) |
boolean |
equals(Object arg0) |
protected int |
getOffsetIntoBytes() |
protected int |
getTreeDepth() |
int |
hashCode() |
protected boolean |
isBalanced() |
boolean |
isValidUtf8() |
com.google.protobuf.ByteString.ByteIterator |
iterator() |
com.google.protobuf.CodedInputStream |
newCodedInput() |
InputStream |
newInput() |
protected int |
partialHash(int arg0,
int arg1,
int arg2) |
protected int |
partialIsValidUtf8(int arg0,
int arg1,
int arg2) |
protected int |
peekCachedHashCode() |
int |
size() |
com.google.protobuf.ByteString |
substring(int arg0,
int arg1) |
String |
toString(String arg0) |
static com.google.protobuf.ByteString |
wrap(byte[] array)
Wraps a byte array in a
ByteString without copying it. |
static com.google.protobuf.ByteString |
wrap(byte[] array,
int offset,
int length)
Wraps a subset of a byte array in a
ByteString without copying it. |
void |
writeTo(OutputStream arg0) |
static byte[] |
zeroCopyGetBytes(com.google.protobuf.ByteString buf)
Extracts the byte array from the given
ByteString without copy. |
public static com.google.protobuf.ByteString wrap(byte[] array)
ByteString without copying it.public static com.google.protobuf.ByteString wrap(byte[] array,
int offset,
int length)
ByteString without copying it.public static byte[] zeroCopyGetBytes(com.google.protobuf.ByteString buf)
ByteString without copy.buf - A buffer from which to extract the array. This buffer must be
actually an instance of a LiteralByteString.public byte byteAt(int arg0)
byteAt in class com.google.protobuf.ByteStringpublic int size()
size in class com.google.protobuf.ByteStringpublic com.google.protobuf.ByteString substring(int arg0,
int arg1)
substring in class com.google.protobuf.ByteStringprotected void copyToInternal(byte[] arg0,
int arg1,
int arg2,
int arg3)
copyToInternal in class com.google.protobuf.ByteStringpublic void copyTo(ByteBuffer arg0)
copyTo in class com.google.protobuf.ByteStringpublic ByteBuffer asReadOnlyByteBuffer()
asReadOnlyByteBuffer in class com.google.protobuf.ByteStringpublic List<ByteBuffer> asReadOnlyByteBufferList()
asReadOnlyByteBufferList in class com.google.protobuf.ByteStringpublic void writeTo(OutputStream arg0) throws IOException
writeTo in class com.google.protobuf.ByteStringIOExceptionpublic String toString(String arg0) throws UnsupportedEncodingException
toString in class com.google.protobuf.ByteStringUnsupportedEncodingExceptionpublic boolean isValidUtf8()
isValidUtf8 in class com.google.protobuf.ByteStringprotected int partialIsValidUtf8(int arg0,
int arg1,
int arg2)
partialIsValidUtf8 in class com.google.protobuf.ByteStringpublic boolean equals(Object arg0)
equals in class com.google.protobuf.ByteStringpublic int hashCode()
hashCode in class com.google.protobuf.ByteStringprotected int peekCachedHashCode()
peekCachedHashCode in class com.google.protobuf.ByteStringprotected int partialHash(int arg0,
int arg1,
int arg2)
partialHash in class com.google.protobuf.ByteStringpublic InputStream newInput()
newInput in class com.google.protobuf.ByteStringpublic com.google.protobuf.CodedInputStream newCodedInput()
newCodedInput in class com.google.protobuf.ByteStringpublic com.google.protobuf.ByteString.ByteIterator iterator()
protected int getTreeDepth()
getTreeDepth in class com.google.protobuf.ByteStringprotected boolean isBalanced()
isBalanced in class com.google.protobuf.ByteStringprotected int getOffsetIntoBytes()
Copyright © 2014 The Apache Software Foundation. All rights reserved.