Class ByteArrayBinaryData

java.lang.Object
co.elastic.clients.util.ByteArrayBinaryData
All Implemented Interfaces:
BinaryData

@JsonpDeserializable public class ByteArrayBinaryData extends Object implements BinaryData
  • Field Details

  • Constructor Details

    • ByteArrayBinaryData

      public ByteArrayBinaryData(byte[] bytes, int offset, int length, String contentType)
    • ByteArrayBinaryData

      public ByteArrayBinaryData(byte[] bytes, String contentType)
    • ByteArrayBinaryData

      public ByteArrayBinaryData(BinaryData data) throws IOException
      Copy another BinaryData. Typically used to make a replayable BinaryData from a non-replayable one.
      Throws:
      IOException
  • Method Details

    • contentType

      public String contentType()
      Description copied from interface: BinaryData
      The content type.
      Specified by:
      contentType in interface BinaryData
    • writeTo

      public void writeTo(OutputStream out) throws IOException
      Description copied from interface: BinaryData
      Write this data to an output stream.
      Specified by:
      writeTo in interface BinaryData
      Throws:
      IOException
    • size

      public long size()
      Description copied from interface: BinaryData
      Get the estimated size in bytes of the data.
      Specified by:
      size in interface BinaryData
      Returns:
      the estimated size, or -1 if the value cannot be estimated or if the data has already been consumed.
    • asByteBuffer

      public ByteBuffer asByteBuffer()
      Description copied from interface: BinaryData
      Return this data as a ByteBuffer.
      Specified by:
      asByteBuffer in interface BinaryData
    • asInputStream

      public InputStream asInputStream()
      Description copied from interface: BinaryData
      Return this data as an InputStream.
      Specified by:
      asInputStream in interface BinaryData
    • isRepeatable

      public boolean isRepeatable()
      Description copied from interface: BinaryData
      Can this object be consumed several times?
      Specified by:
      isRepeatable in interface BinaryData