try {
byte[] buffer = source.get(bufferSize());
feed(buffer);
- } catch (IOException e) {
- return;
+ } catch (IOException ioe1) {
+ break;
}
}
+ try {
+ finish();
+ } catch (IOException ioe1) {
+ /* well, what can we do? nothing. */
+ }
}
//
*/
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;
+
}