Class BinaryContentImpl

java.lang.Object
ddf.catalog.data.impl.BinaryContentImpl
All Implemented Interfaces:
ddf.catalog.data.BinaryContent
Direct Known Subclasses:
ResourceImpl

public class BinaryContentImpl extends Object implements ddf.catalog.data.BinaryContent
This class is a common implementation of the BinaryContent interface.
  • Constructor Details

    • BinaryContentImpl

      public BinaryContentImpl(InputStream inputStream, javax.activation.MimeType mimeType)
      Instantiates a new product resource.
      Parameters:
      inputStream - the input stream
      mimeType - the mime type for the resource
    • BinaryContentImpl

      public BinaryContentImpl(InputStream inputStream)
      Instantiates a new product resource.
      Parameters:
      inputStream - the input stream
  • Method Details

    • getInputStream

      public InputStream getInputStream()
      Specified by:
      getInputStream in interface ddf.catalog.data.BinaryContent
    • getMimeType

      public javax.activation.MimeType getMimeType()
      Specified by:
      getMimeType in interface ddf.catalog.data.BinaryContent
    • getMimeTypeValue

      public String getMimeTypeValue()
      Specified by:
      getMimeTypeValue in interface ddf.catalog.data.BinaryContent
    • toString

      public String toString()
      String representation of this BinaryContentImpl.
      Overrides:
      toString in class Object
      Returns:
      the String representation of this BinaryContentImpl
    • getSize

      public long getSize()
      Specified by:
      getSize in interface ddf.catalog.data.BinaryContent
    • setSize

      public void setSize(long size)
      Sets the size in bytes of the binary content. If the size is unknown, then a -1 is returned.
      Parameters:
      size -
    • getByteArray

      public byte[] getByteArray() throws IOException
      Specified by:
      getByteArray in interface ddf.catalog.data.BinaryContent
      Throws:
      IOException