Java 类org.jivesoftware.smackx.bytestreams.socks5.Socks5BytestreamRequest 实例源码

项目:Smack    文件:Socks5TransferNegotiator.java   
@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);
    }
}
项目:EIM    文件:Socks5TransferNegotiator.java   
@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);
    }
}
项目:androidPN-client.    文件:Socks5TransferNegotiator.java   
@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);
    }
}
项目:xmppsupport_v2    文件:Socks5TransferNegotiator.java   
@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);
    }
}
项目:java-bells    文件:Socks5TransferNegotiator.java   
@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);
    }
}
项目:telegraph    文件:Socks5TransferNegotiator.java   
@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);
    }
}