ByteString to the application.Disclaimer
The methods in this class should only be called if it is
guaranteed that the buffer backing the ByteString will never change! Mutation of a ByteString can lead to unexpected and undesirable consequences in your application, and will
likely be difficult to debug. Proceed with caution!
This can have a number of significant side affects that have spooky-action-at-a-distance-like behavior. In particular, if the bytes value changes out from under a Protocol Buffer:
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static ByteString | Returns: aByteString backed by the provided bufferthe buffer to be wrapped buffer)An unsafe operation that returns a |
| public static ByteString | Returns: aByteString backed by the provided bufferthe buffer to be wrapped buffer, int the offset of the wrapped region offset, int the number of bytes of the wrapped region length)An unsafe operation that returns a |
| public static ByteString | Returns: aByteString backed by the provided bufferthe Java NIO buffer to be wrapped buffer)An unsafe operation that returns a |
| public static void | unsafeWriteTo(ByteString
the bytes, ByteOutput ByteString to be writtenthe output to receive the bytes output)Writes the given |
| UnsafeByteOperations | back to summary |
|---|---|
| private UnsafeByteOperations() | |
| unsafeWrap | back to summary |
|---|---|
| public static ByteString unsafeWrap(byte[] buffer) An unsafe operation that returns a
| |
| unsafeWrap | back to summary |
|---|---|
| public static ByteString unsafeWrap(byte[] buffer, int offset, int length) An unsafe operation that returns a
| |
| unsafeWrap | back to summary |
|---|---|
| public static ByteString unsafeWrap(ByteBuffer buffer) An unsafe operation that returns a
| |
| unsafeWriteTo | back to summary |
|---|---|
| public static void unsafeWriteTo(ByteString bytes, ByteOutput output) throws IOException Writes the given This method exposes the internal backing buffer(s) of the Note The
| |