I have an application that may receive data via various methods and in various formats. I have pluggable receivers that somehow acquire the data (e. g. by polling a mailbox, listening for HTTP requests, watch the content of a directory etc.), associate it with a MIME type and then pass it on wrapped like this:
public class Transmission {
private String origin; // where the data came from
private String destination; // where the data was sent to
private String mime; // the MIME type of the data
private BLOB data; // this is what I need an appropriate type for
}
Further down the line, the data is processed by specialized handlers according to the value of the mime
field. I'm expecting things like ZIP files, Excel documents, SOAP, generic XML, plain text and more. At this point, the code should be agnostic as to what's in the data. What is an appropriate type for the data
field? Object
? InputStream
? Byte[]
?