public final class ByteStringBytes
extends com.avast.bytes.AbstractBytes
Bytes that wraps ByteString.
The only way how to create an instance is by calling wrap(ByteString).
The underlying ByteString can be accessed directly by calling underlying().
| Modifier and Type | Method and Description |
|---|---|
byte |
byteAt(int index) |
boolean |
equals(java.lang.Object o) |
java.io.InputStream |
newInputStream() |
int |
size() |
byte[] |
toByteArray() |
java.nio.ByteBuffer |
toReadOnlyByteBuffer() |
java.lang.String |
toString(java.nio.charset.Charset charset) |
com.google.protobuf.ByteString |
underlying()
Returns the
ByteString wrapped by this ByteStringBytes. |
ByteStringBytes |
view(int beginIndex,
int endIndex) |
static ByteStringBytes |
wrap(com.google.protobuf.ByteString buf)
Wraps an existing instance of
ByteString |
public int size()
public byte byteAt(int index)
public byte[] toByteArray()
public java.nio.ByteBuffer toReadOnlyByteBuffer()
public java.lang.String toString(java.nio.charset.Charset charset)
public java.io.InputStream newInputStream()
public ByteStringBytes view(int beginIndex, int endIndex)
public com.google.protobuf.ByteString underlying()
ByteString wrapped by this ByteStringBytes.ByteString wrapped by this ByteStringBytespublic boolean equals(java.lang.Object o)
equals in class com.avast.bytes.AbstractBytespublic static ByteStringBytes wrap(com.google.protobuf.ByteString buf)
ByteStringbuf - ByteString to wrapByteStringBytes wrapping the specified ByteString