Interface BinaryContent

All Known Subinterfaces:
Resource

public interface BinaryContent
BinaryContent is used to return a format that has been transformed by a Transformer.
See Also:
  • Method Details

    • getInputStream

      InputStream getInputStream()
      Gets the input stream.

      Note that the binary from the InputStream can only be accessed once. Thus, when you call getInputStream() and retrieve the InputStream object, it can only be used once to extract the content. If it is necessary that the bytes of the InputStream object are needed again, use the getByteArray() method instead.

      Returns:
      an input stream
    • getMimeType

      javax.activation.MimeType getMimeType()
      Returns:
      the mime type of the information in the InputStream
    • getMimeTypeValue

      String getMimeTypeValue()
      Gets the String format MimeType
      Returns:
      the mime type as a String
    • getSize

      long getSize()
      Get the size if known.
      Returns:
      the amount of bytes as a long, -1 if unknown
    • getByteArray

      byte[] getByteArray() throws IOException
      Convenience method to attempt to read the contents of the InputStream into a byte array.

      Note that getByteArray() should be idempotent if getInputStream() has not been initially invoked.

      Returns:
      byte[]
      Throws:
      IOException - if the stream can not be read into the array