long contentLength = stream.getContentLength();
if ( contentLength != SourceStream.LENGTH_UNKNOWN ) {
double durationSeconds = contentLength / bytesPerSecond;
duration = new Time(durationSeconds);
maxLocation = contentLength;
} else {
maxLocation = Long.MAX_VALUE;
}