if (!(source instanceof PullBufferDataSource)) {
throw new IncompatibleSourceException("DataSource not supported: " + source);
} else {
streams = ((PullBufferDataSource) source).getStreams();
}
if ( streams == null) {
throw new IOException("Got a null stream from the DataSource");
}
if (streams.length == 0) {
throw new IOException("Got a empty stream array from the DataSource");
}
if (!supports(streams))
throw new IncompatibleSourceException("DataSource not supported: " + source);
this.source = source;
this.streams = streams;
// System.out.println("content length is " + streams[0].getContentLength());