@Override
public TimedInputStream openNewDataConnection() {
logger.trace("openNewDataConnection() fetching blob for encoding {}",
encoding);
final JizzBlobReader blobReader = jizzBlobServices.retrieveBlob(
station, encoding.getBlobRef());
// Want to ensure the enclosing blob reader gets closed when the input
// stream is finished with
return new CbrTimedInputStream(blobReader.getInputStream(),
encoding.getBitRateKbps()) {
@Override
public void close() throws IOException {
logger.trace("Calling super.close()");
super.close();
logger.trace("Closing enclosing blob reader");
blobReader.close();
}
};
}