*/
protected abstract void feed(byte[] buffer) throws IOException;
+ /**
+ * Notifies the sink that the source does not deliver any more data.
+ *
+ * @throws IOException
+ * if an I/O error occurs
+ */
+ protected abstract void finish() throws IOException;
+
}
protected void feed(byte[] buffer) throws IOException {
processInput.write(buffer);
}
+
+ @Override
+ protected void finish() throws IOException {
+ processInput.close();
+ }
}).start();
} catch (IOException ioe1) {
sourceDataLine.write(buffer, 0, buffer.length);
logger.finest(String.format("AudioSink: Wrote %d Bytes.", buffer.length));
}
+
+ @Override
+ protected void finish() {
+ sourceDataLine.stop();
+ }
}).start();
}
catch (LineUnavailableException lue1) {