@Override public void truncateWrites() throws IOException { freeBuffer(); state |= CLOSED; next.truncateWrites(); }
@Override public long write(final ByteBuffer[] srcs, final int offset, final int length) throws IOException { if (anyAreSet(state, SHUTDOWN | CLOSED) || currentBuffer == null) { throw new ClosedChannelException(); } try { int total = 0; for (int i = offset; i < offset + length; ++i) { if (srcs[i].hasRemaining()) { int ret = write(srcs[i]); total += ret; if (ret == 0) { return total; } } } return total; } catch (IOException | RuntimeException | Error e) { freeBuffer(); throw e; } }
return data.length; } catch (IOException | RuntimeException | Error e) { freeBuffer(); throw e;
freeBuffer(); next.terminateWrites(); return next.flush(); freeBuffer(); throw e;
@Override public void truncateWrites() throws IOException { freeBuffer(); state |= CLOSED; next.truncateWrites(); }
@Override public void truncateWrites() throws IOException { freeBuffer(); state |= CLOSED; next.truncateWrites(); }
@Override public long write(final ByteBuffer[] srcs, final int offset, final int length) throws IOException { if (anyAreSet(state, SHUTDOWN | CLOSED) || currentBuffer == null) { throw new ClosedChannelException(); } try { int total = 0; for (int i = offset; i < offset + length; ++i) { if (srcs[i].hasRemaining()) { int ret = write(srcs[i]); total += ret; if (ret == 0) { return total; } } } return total; } catch (IOException | RuntimeException | Error e) { freeBuffer(); throw e; } }
@Override public long write(final ByteBuffer[] srcs, final int offset, final int length) throws IOException { if (anyAreSet(state, SHUTDOWN | CLOSED) || currentBuffer == null) { throw new ClosedChannelException(); } try { int total = 0; for (int i = offset; i < offset + length; ++i) { if (srcs[i].hasRemaining()) { int ret = write(srcs[i]); total += ret; if (ret == 0) { return total; } } } return total; } catch (IOException | RuntimeException | Error e) { freeBuffer(); throw e; } }
return data.length; } catch (IOException | RuntimeException | Error e) { freeBuffer(); throw e;
return data.length; } catch (IOException | RuntimeException | Error e) { freeBuffer(); throw e;
freeBuffer(); next.terminateWrites(); return next.flush(); freeBuffer(); throw e;
freeBuffer(); next.terminateWrites(); return next.flush(); freeBuffer(); throw e;