@InterfaceAudience.Private
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. |
concat, copyFrom, copyFrom, copyFrom, copyFrom, copyFrom, copyFrom, copyFromUtf8, copyTo, copyTo, isEmpty, newOutput, newOutput, readFrom, readFrom, readFrom, startsWith, substring, toByteArray, toString, toStringUtf8
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
forEach, spliterator
public static com.google.protobuf.ByteString wrap(byte[] array)
ByteString
without copying it.array
- array to be wrappedpublic static com.google.protobuf.ByteString wrap(byte[] array, int offset, int length)
ByteString
without copying it.array
- array to be wrappedoffset
- fromlength
- lengthpublic 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.ByteString
public int size()
size
in class com.google.protobuf.ByteString
public com.google.protobuf.ByteString substring(int arg0, int arg1)
substring
in class com.google.protobuf.ByteString
protected void copyToInternal(byte[] arg0, int arg1, int arg2, int arg3)
copyToInternal
in class com.google.protobuf.ByteString
public void copyTo(ByteBuffer arg0)
copyTo
in class com.google.protobuf.ByteString
public ByteBuffer asReadOnlyByteBuffer()
asReadOnlyByteBuffer
in class com.google.protobuf.ByteString
public List<ByteBuffer> asReadOnlyByteBufferList()
asReadOnlyByteBufferList
in class com.google.protobuf.ByteString
public void writeTo(OutputStream arg0) throws IOException
writeTo
in class com.google.protobuf.ByteString
IOException
public String toString(String arg0) throws UnsupportedEncodingException
toString
in class com.google.protobuf.ByteString
UnsupportedEncodingException
public boolean isValidUtf8()
isValidUtf8
in class com.google.protobuf.ByteString
protected int partialIsValidUtf8(int arg0, int arg1, int arg2)
partialIsValidUtf8
in class com.google.protobuf.ByteString
public boolean equals(Object arg0)
equals
in class com.google.protobuf.ByteString
public int hashCode()
hashCode
in class com.google.protobuf.ByteString
protected int peekCachedHashCode()
peekCachedHashCode
in class com.google.protobuf.ByteString
protected int partialHash(int arg0, int arg1, int arg2)
partialHash
in class com.google.protobuf.ByteString
public InputStream newInput()
newInput
in class com.google.protobuf.ByteString
public com.google.protobuf.CodedInputStream newCodedInput()
newCodedInput
in class com.google.protobuf.ByteString
public com.google.protobuf.ByteString.ByteIterator iterator()
protected int getTreeDepth()
getTreeDepth
in class com.google.protobuf.ByteString
protected boolean isBalanced()
isBalanced
in class com.google.protobuf.ByteString
protected int getOffsetIntoBytes()
Copyright © 2007–2019 Cloudera. All rights reserved.