@Override public int data(ChannelSession channel, byte[] buf, int start, int len) throws IOException { in.write(new ByteArrayBuffer(buf, start, len)); return 0; }
@Override public int data(ChannelSession channel, byte[] buf, int start, int len) throws IOException { in.write(new ByteArrayBuffer(buf, start, len)); return 0; }
@Override protected void doWriteData(byte[] data, int off, long len) throws IOException { // If we're already closing, ignore incoming data if (isClosing()) { return; } ValidateUtils.checkTrue(len <= Integer.MAX_VALUE, "Data length exceeds int boundaries: %d", len); if (asyncOut != null) { asyncOut.write(new ByteArrayBuffer(data, off, (int) len)); } else if (out != null) { out.write(data, off, (int) len); out.flush(); if (invertedOut == null) { Window wLocal = getLocalWindow(); wLocal.consumeAndCheck(len); } } else { throw new IllegalStateException("No output stream for channel"); } }
@Override protected void doWriteExtendedData(byte[] data, int off, long len) throws IOException { // If we're already closing, ignore incoming data if (isClosing()) { return; } ValidateUtils.checkTrue(len <= Integer.MAX_VALUE, "Extended data length exceeds int boundaries: %d", len); if (asyncErr != null) { asyncErr.write(new ByteArrayBuffer(data, off, (int) len)); } else if (err != null) { err.write(data, off, (int) len); err.flush(); if (invertedErr == null) { Window wLocal = getLocalWindow(); wLocal.consumeAndCheck(len); } } else { throw new IllegalStateException("No error stream for channel"); } }
@Override protected void doWriteData(byte[] data, int off, long len) throws IOException { // If we're already closing, ignore incoming data if (isClosing()) { return; } ValidateUtils.checkTrue(len <= Integer.MAX_VALUE, "Data length exceeds int boundaries: %d", len); if (asyncOut != null) { asyncOut.write(new ByteArrayBuffer(data, off, (int) len)); } else if (out != null) { out.write(data, off, (int) len); out.flush(); if (invertedOut == null) { Window wLocal = getLocalWindow(); wLocal.consumeAndCheck(len); } } else { throw new IllegalStateException("No output stream for channel"); } }
@Override protected void doWriteExtendedData(byte[] data, int off, long len) throws IOException { // If we're already closing, ignore incoming data if (isClosing()) { return; } ValidateUtils.checkTrue(len <= Integer.MAX_VALUE, "Extended data length exceeds int boundaries: %d", len); if (asyncErr != null) { asyncErr.write(new ByteArrayBuffer(data, off, (int) len)); } else if (err != null) { err.write(data, off, (int) len); err.flush(); if (invertedErr == null) { Window wLocal = getLocalWindow(); wLocal.consumeAndCheck(len); } } else { throw new IllegalStateException("No error stream for channel"); } }