private final int rate;
/** The source’s format. */
- private Format format;
+ private Source source;
/** The input stream to read from. */
private PipedInputStream pipedInputStream = new PipedInputStream();
@Override
public Format format() {
- return format;
+ return source.format();
}
@Override
public void connect(Source source) throws ConnectException {
Preconditions.checkNotNull(source, "source must not be null");
- format = source.format();
+ this.source = source;
final long start = System.currentTimeMillis();
try {
pipedInputStream = new PipedInputStream();