Package ddf.catalog.data
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:
-
InputTransformerQueryResponseTransformer
-
Method Details
-
getInputStream
InputStream getInputStream()Gets the input stream.Note that the binary from the
InputStreamcan only be accessed once. Thus, when you callgetInputStream()and retrieve theInputStreamobject, it can only be used once to extract the content. If it is necessary that the bytes of theInputStreamobject are needed again, use thegetByteArray()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 theStringformatMimeType- 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
Convenience method to attempt to read the contents of theInputStreaminto abytearray.Note that
getByteArray()should be idempotent ifgetInputStream()has not been initially invoked.- Returns:
- byte[]
- Throws:
IOException- if the stream can not be read into the array
-