public final class UnsafeByteStrings extends Object
ByteString
instances.
DISCLAIMER: The methods in this class should only be called if it is
guaranteed that the 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!
Modifier and Type | Method and Description |
---|---|
static ByteString |
unsafeWrap(ByteBuffer buffer)
An unsafe operation that returns a
ByteString that is backed by the provided buffer. |
public static ByteString unsafeWrap(ByteBuffer buffer)
ByteString
that is backed by the provided buffer.buffer
- the Java NIO buffer to be wrapped.ByteString
backed by the provided buffer.Copyright © 2008–2016 Google. All rights reserved.