public interface BytesSupplier
byte[]
.Modifier and Type | Method and Description |
---|---|
default byte[] |
getAsBytes()
Returns the
byte[] presentation of the object. |
default java.lang.Object |
getAsObject()
Returns the object that backs this
BytesSupplier . |
default java.lang.String |
getAsString()
Returns the
String presentation of the object. |
java.nio.ByteBuffer |
toByteBuffer()
Returns the
ByteBuffer presentation of the object. |
static BytesSupplier |
wrap(byte[] buf)
Wraps a byte array into a {code BytesSupplier}.
|
static BytesSupplier |
wrap(java.lang.String value)
Wraps a string into a {code BytesSupplier}.
|
static BytesSupplier |
wrapAsJson(java.lang.Object object)
Wraps an object as json into a {code BytesSupplier}.
|
default byte[] getAsBytes()
byte[]
presentation of the object.byte[]
presentation of the objectdefault java.lang.String getAsString()
String
presentation of the object.String
presentation of the objectdefault java.lang.Object getAsObject()
BytesSupplier
.BytesSupplier
java.nio.ByteBuffer toByteBuffer()
ByteBuffer
presentation of the object.ByteBuffer
presentation of the objectstatic BytesSupplier wrap(byte[] buf)
buf
- the byte array that will back this {code BytesSupplier}BytesSupplier
static BytesSupplier wrap(java.lang.String value)
value
- the string that will back this {code BytesSupplier}BytesSupplier
static BytesSupplier wrapAsJson(java.lang.Object object)
object
- the object that will back this {code BytesSupplier}BytesSupplier