@Override InputStream negotiateIncomingStream(Stanza streamInitiation) throws InterruptedException, SmackException, XMPPErrorException { // build SOCKS5 Bytestream request Socks5BytestreamRequest request = new ByteStreamRequest(this.manager, (Bytestream) streamInitiation); // always accept the request Socks5BytestreamSession session = request.accept(); // test input stream try { PushbackInputStream stream = new PushbackInputStream(session.getInputStream()); int firstByte = stream.read(); stream.unread(firstByte); return stream; } catch (IOException e) { throw new SmackException("Error establishing input stream", e); } }
@Override InputStream negotiateIncomingStream(Packet streamInitiation) throws XMPPException, InterruptedException { // build SOCKS5 Bytestream request Socks5BytestreamRequest request = new ByteStreamRequest(this.manager, (Bytestream) streamInitiation); // always accept the request Socks5BytestreamSession session = request.accept(); // test input stream try { PushbackInputStream stream = new PushbackInputStream(session.getInputStream()); int firstByte = stream.read(); stream.unread(firstByte); return stream; } catch (IOException e) { throw new XMPPException("Error establishing input stream", e); } }
@Override InputStream negotiateIncomingStream(Packet streamInitiation) throws XMPPException, InterruptedException { // build SOCKS5 Bytestream request Socks5BytestreamRequest request = new ByteStreamRequest(this.manager, (Bytestream) streamInitiation); // always accept the request Socks5BytestreamSession session = request.accept(); // test input stream try { PushbackInputStream stream = new PushbackInputStream( session.getInputStream()); int firstByte = stream.read(); stream.unread(firstByte); return stream; } catch (IOException e) { throw new XMPPException("Error establishing input stream", e); } }