@Override public void write(int b) throws IOException { if (channel.isClosed() || channel.isClosing()) { throw new IOException("Channel (" + channel + ") is closing / closed on write single byte"); } if (b == (eofSignal & 0xff)) { log.info("Closing channel (" + channel + ") due to single byte EOF"); channel.close(true); } }
@Override public void write(int b) throws IOException { if (channel.isClosed() || channel.isClosing()) { throw new IOException("Channel (" + channel + ") is closing / closed on write single byte"); } if (b == (eofSignal & 0xff)) { log.info("Closing channel (" + channel + ") due to single byte EOF"); channel.close(true); } }
@Override public void write(int b) throws IOException { if (channel.isClosed() || channel.isClosing()) { throw new IOException("Channel (" + channel + ") is closing / closed on write single byte"); } if (b == (eofSignal & 0xff)) { log.info("Closing channel (" + channel + ") due to single byte EOF"); channel.close(true); } }
@Override public void write(byte[] b, int off, int len) throws IOException { if (channel.isClosed() || channel.isClosing()) { throw new IOException("Channel (" + channel + ") is closing / closed on write " + len + " bytes"); } if (len <= 0) { return; } int lastPos = off + len - 1; if ((b[lastPos] & 0xFF) == (eofSignal & 0xFF)) { log.info("Closing channel (" + channel + ") due to last byte EOF"); channel.close(true); } } }
@Override public void write(byte[] b, int off, int len) throws IOException { if (channel.isClosed() || channel.isClosing()) { throw new IOException("Channel (" + channel + ") is closing / closed on write " + len + " bytes"); } if (len <= 0) { return; } int lastPos = off + len - 1; if ((b[lastPos] & 0xFF) == (eofSignal & 0xFF)) { log.info("Closing channel (" + channel + ") due to last byte EOF"); channel.close(true); } } }
@Override public void write(byte[] b, int off, int len) throws IOException { if (channel.isClosed() || channel.isClosing()) { throw new IOException("Channel (" + channel + ") is closing / closed on write " + len + " bytes"); } if (len <= 0) { return; } int lastPos = off + len - 1; if ((b[lastPos] & 0xFF) == (eofSignal & 0xFF)) { log.info("Closing channel (" + channel + ") due to last byte EOF"); channel.close(true); } } }