Package co.elastic.clients.util
Class ByteArrayBinaryData
java.lang.Object
co.elastic.clients.util.ByteArrayBinaryData
- All Implemented Interfaces:
BinaryData
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionByteArrayBinaryData(byte[] bytes, int offset, int length, String contentType) ByteArrayBinaryData(byte[] bytes, String contentType) Copy anotherBinaryData. -
Method Summary
Modifier and TypeMethodDescriptionReturn this data as aByteBuffer.Return this data as anInputStream.The content type.booleanCan this object be consumed several times?longsize()Get the estimated size in bytes of the data.voidwriteTo(OutputStream out) Write this data to an output stream.
-
Field Details
-
_DESERIALIZER
-
-
Constructor Details
-
ByteArrayBinaryData
-
ByteArrayBinaryData
-
ByteArrayBinaryData
Copy anotherBinaryData. Typically used to make a replayableBinaryDatafrom a non-replayable one.- Throws:
IOException
-
-
Method Details
-
contentType
Description copied from interface:BinaryDataThe content type.- Specified by:
contentTypein interfaceBinaryData
-
writeTo
Description copied from interface:BinaryDataWrite this data to an output stream.- Specified by:
writeToin interfaceBinaryData- Throws:
IOException
-
size
public long size()Description copied from interface:BinaryDataGet the estimated size in bytes of the data.- Specified by:
sizein interfaceBinaryData- Returns:
- the estimated size, or
-1if the value cannot be estimated or if the data has already been consumed.
-
asByteBuffer
Description copied from interface:BinaryDataReturn this data as aByteBuffer.- Specified by:
asByteBufferin interfaceBinaryData
-
asInputStream
Description copied from interface:BinaryDataReturn this data as anInputStream.- Specified by:
asInputStreamin interfaceBinaryData
-
isRepeatable
public boolean isRepeatable()Description copied from interface:BinaryDataCan this object be consumed several times?- Specified by:
isRepeatablein interfaceBinaryData
-