public PipeDataReceiver(PropertyResolver resolver, Window localWindow) { ChannelPipedInputStream in = new ChannelPipedInputStream(resolver, localWindow); this.in = in; this.out = new ChannelPipedOutputStream(in); if (log.isTraceEnabled()) { out = new LoggingFilterOutputStream(out, "IN(" + resolver + "): ", log, resolver); } }
@Override public void receive(byte[] bytes, int off, int len) throws IOException { lock.lock(); try { if (writerClosed.get() || (!isOpen())) { throw new IOException("Pipe closed"); } buffer.putRawBytes(bytes, off, len); dataAvailable.signalAll(); } finally { lock.unlock(); } } }
@Override public int read() throws IOException { synchronized (b) { int l = read(b, 0, 1); if (l == -1) { return -1; } return b[0] & 0xff; } }
public PipeDataReceiver(PropertyResolver resolver, Window localWindow) { ChannelPipedInputStream in = new ChannelPipedInputStream(resolver, localWindow); this.in = in; this.out = new ChannelPipedOutputStream(in); if (log.isTraceEnabled()) { out = new LoggingFilterOutputStream(out, "IN(" + resolver + "): ", log, resolver); } }
@Override public void receive(byte[] bytes, int off, int len) throws IOException { lock.lock(); try { if (writerClosed.get() || (!isOpen())) { throw new IOException("Pipe closed"); } buffer.putRawBytes(bytes, off, len); dataAvailable.signalAll(); } finally { lock.unlock(); } } }
@Override public int read() throws IOException { synchronized (b) { int l = read(b, 0, 1); if (l == -1) { return -1; } return b[0] & 0xff; } }
@Override protected void doOpen() throws IOException { if (streaming == Streaming.Async) { asyncIn = new ChannelAsyncOutputStream(this, SshConstants.SSH_MSG_CHANNEL_DATA); asyncOut = new ChannelAsyncInputStream(this); } else { out = new ChannelOutputStream(this, getRemoteWindow(), log, SshConstants.SSH_MSG_CHANNEL_DATA, true); invertedIn = out; ChannelPipedInputStream pis = new ChannelPipedInputStream(this, getLocalWindow()); pipe = new ChannelPipedOutputStream(pis); in = pis; invertedOut = in; } }
try { for (int index = 0;; index++) { boolean openState = isOpen(); boolean writerClosedState = writerClosed.get(); if (((!openState) && writerClosedState && eofSent.get()) || ((!openState) && (!writerClosedState))) {
@Override protected void doOpen() throws IOException { if (streaming == Streaming.Async) { asyncIn = new ChannelAsyncOutputStream(this, SshConstants.SSH_MSG_CHANNEL_DATA); asyncOut = new ChannelAsyncInputStream(this); } else { out = new ChannelOutputStream(this, getRemoteWindow(), log, SshConstants.SSH_MSG_CHANNEL_DATA, true); invertedIn = out; ChannelPipedInputStream pis = new ChannelPipedInputStream(this, getLocalWindow()); pipe = new ChannelPipedOutputStream(pis); in = pis; invertedOut = in; } }
try { for (int index = 0;; index++) { boolean openState = isOpen(); boolean writerClosedState = writerClosed.get(); if (((!openState) && writerClosedState && eofSent.get()) || ((!openState) && (!writerClosedState))) {
ChannelPipedInputStream pis = new ChannelPipedInputStream(this, wLocal); ChannelPipedOutputStream pos = new ChannelPipedOutputStream(pis); out = pos; ChannelPipedInputStream pis = new ChannelPipedInputStream(this, wLocal); ChannelPipedOutputStream pos = new ChannelPipedOutputStream(pis); err = pos;
ChannelPipedInputStream pis = new ChannelPipedInputStream(this, wLocal); ChannelPipedOutputStream pos = new ChannelPipedOutputStream(pis); out = pos; ChannelPipedInputStream pis = new ChannelPipedInputStream(this, wLocal); ChannelPipedOutputStream pos = new ChannelPipedOutputStream(pis); err = pos;