@Override public void close() throws IOException { if (closed.compareAndSet(false, true)) { try { originalStream.close(); } catch (IOException e) { handleIOException(e); } finally { fs.unregisterOutputStream(this); } } }
@Override public void close() throws IOException { if (closed.compareAndSet(false, true)) { try { originalStream.close(); } catch (IOException e) { handleIOException(e); } finally { fs.unregisterOutputStream(this); } } }
@Override public void close() throws IOException { if (closed.compareAndSet(false, true)) { try { originalStream.close(); } catch (IOException e) { handleIOException(e); } finally { fs.unregisterOutputStream(this); } } }
@Override public void flush() throws IOException { try { originalStream.flush(); } catch (IOException e) { handleIOException(e); } }
@Override public void write(byte[] b, int off, int len) throws IOException { try { originalStream.write(b, off, len); } catch (IOException e) { handleIOException(e); } }
@Override public void flush() throws IOException { try { originalStream.flush(); } catch (IOException e) { handleIOException(e); } }
@Override public void write(int b) throws IOException { try { originalStream.write(b); } catch (IOException e) { handleIOException(e); } }
@Override public void write(byte[] b, int off, int len) throws IOException { try { originalStream.write(b, off, len); } catch (IOException e) { handleIOException(e); } }
@Override public void closeDueToTimeout() throws IOException { this.timeoutException = new StreamTimeoutException(); close(); }
private FSDataOutputStream createOutputStream( final SupplierWithException<FSDataOutputStream, IOException> streamOpener) throws IOException { final SupplierWithException<OutStream, IOException> wrappedStreamOpener = () -> new OutStream(streamOpener.get(), this); return createStream(wrappedStreamOpener, openOutputStreams, true); }
@Override public void sync() throws IOException { try { originalStream.sync(); } catch (IOException e) { handleIOException(e); } }
private FSDataOutputStream createOutputStream( final SupplierWithException<FSDataOutputStream, IOException> streamOpener) throws IOException { final SupplierWithException<OutStream, IOException> wrappedStreamOpener = () -> new OutStream(streamOpener.get(), this); return createStream(wrappedStreamOpener, openOutputStreams, true); }
@Override public long getPos() throws IOException { try { return originalStream.getPos(); } catch (IOException e) { handleIOException(e); return -1; // silence the compiler } }
@Override public void write(int b) throws IOException { try { originalStream.write(b); } catch (IOException e) { handleIOException(e); } }
@Override public void sync() throws IOException { try { originalStream.sync(); } catch (IOException e) { handleIOException(e); } }
@Override public void closeDueToTimeout() throws IOException { this.timeoutException = new StreamTimeoutException(); close(); }
@Override public long getPos() throws IOException { try { return originalStream.getPos(); } catch (IOException e) { handleIOException(e); return -1; // silence the compiler } }
@Override public void write(int b) throws IOException { try { originalStream.write(b); } catch (IOException e) { handleIOException(e); } }
@Override public void closeDueToTimeout() throws IOException { this.timeoutException = new StreamTimeoutException(); close(); }
private FSDataOutputStream createOutputStream( final SupplierWithException<FSDataOutputStream, IOException> streamOpener) throws IOException { final SupplierWithException<OutStream, IOException> wrappedStreamOpener = () -> new OutStream(streamOpener.get(), this); return createStream(wrappedStreamOpener, openOutputStreams, true); }