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 aByteBufferstatic BinaryDataof(byte[] bytes) static BinaryDataof(byte[] value, int offset, int length) static BinaryDataof(Object value, JsonpMapper mapper) Create aBinaryDatafrom a value and a JSON mapper.longsize()Get the estimated size in bytes of the data.voidwriteTo(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
-1if the value cannot be estimated or if the data has already been consumed.
-
of
Create aBinaryDatafrom a value and a JSON mapper. The binary content is the result of serializingvaluewithmapper. Returnsnullifvalueis null. -
of
-
of
-