Interface BytesSupplier

All Known Subinterfaces:
LazyNDArray, NDArray, SparseNDArray
All Known Implementing Classes:
CategoryMask, ChunkedBytesSupplier, Classifications, DetectedObjects, IteratorBytesSupplier, Landmark, Mask, NDArrayAdapter, NDList, PublisherBytesSupplier, Rectangle

public interface BytesSupplier
Represents a supplier of byte[].
  • Method Summary

    Modifier and Type
    Method
    Description
    default byte[]
    Returns the byte[] presentation of the object.
    default Object
    Returns the object that backs this BytesSupplier.
    default String
    Returns the String presentation of the object.
    Returns the ByteBuffer presentation of the object.
    wrap(byte[] buf)
    Wraps a byte array into a {code BytesSupplier}.
    wrap(String value)
    Wraps a string into a {code BytesSupplier}.
    Wraps an object as json into a {code BytesSupplier}.
  • Method Details

    • getAsBytes

      default byte[] getAsBytes()
      Returns the byte[] presentation of the object.
      Returns:
      the byte[] presentation of the object
    • getAsString

      default String getAsString()
      Returns the String presentation of the object.
      Returns:
      the String presentation of the object
    • getAsObject

      default Object getAsObject()
      Returns the object that backs this BytesSupplier.
      Returns:
      the object that backs this BytesSupplier
    • toByteBuffer

      ByteBuffer toByteBuffer()
      Returns the ByteBuffer presentation of the object.
      Returns:
      the ByteBuffer presentation of the object
    • wrap

      static BytesSupplier wrap(byte[] buf)
      Wraps a byte array into a {code BytesSupplier}.
      Parameters:
      buf - the byte array that will back this {code BytesSupplier}
      Returns:
      a BytesSupplier
    • wrap

      static BytesSupplier wrap(String value)
      Wraps a string into a {code BytesSupplier}.
      Parameters:
      value - the string that will back this {code BytesSupplier}
      Returns:
      a BytesSupplier
    • wrapAsJson

      static BytesSupplier wrapAsJson(Object object)
      Wraps an object as json into a {code BytesSupplier}.
      Parameters:
      object - the object that will back this {code BytesSupplier}
      Returns:
      a BytesSupplier