- final FileOutputStream fileOutputStream = new FileOutputStream(path);
- new Thread(new Connection(source) {
-
- @Override
- protected int bufferSize() {
- return 65536;
- }
-
- @Override
- protected void feed(byte[] buffer) throws IOException {
- fileOutputStream.write(buffer);
- logger.finest(String.format("FileSink: Wrote %d Bytes.", buffer.length));
- }
-
- @Override
- protected void finish() throws IOException {
- fileOutputStream.close();
- }
- }).start();
- } catch (FileNotFoundException fnfe1) {
- throw new ConnectException(fnfe1);