Package co.elastic.clients.util
Interface BinaryData
- All Known Implementing Classes:
BinaryData.ByteArrayBinaryData
public interface BinaryData
Binary data representing a serialized value.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionReturn this data as aByteBuffer
static BinaryData
of
(byte[] bytes) static BinaryData
of
(byte[] value, int offset, int length) static BinaryData
of
(Object value, JsonpMapper mapper) Create aBinaryData
from a value and a JSON mapper.long
size()
Get the estimated size in bytes of the data.void
writeTo
(OutputStream out) Write this data to an output stream.
-
Method Details
-
writeTo
Write this data to an output stream.- Throws:
IOException
-
asByteBuffer
ByteBuffer asByteBuffer()Return this data as aByteBuffer
-
size
long size()Get the estimated size in bytes of the data.- Returns:
- the estimated size, or
-1
if the value cannot be estimated or if the data has already been consumed.
-
of
Create aBinaryData
from a value and a JSON mapper. The binary content is the result of serializingvalue
withmapper
. Returnsnull
ifvalue
is null. -
of
-
of
-