Package java.io

Examples of java.io.DataInputStream.readByte()


      dos.writeByte( (byte)0 ); // no auth
      dos.writeByte( (byte)2 ); // user/pw
     
      dos.flush();
     
        dis.readByte()// version byte
       
        byte method = dis.readByte();

        if ( method != 0 && method != 2 ){
         
View Full Code Here


     
      dos.flush();
     
        dis.readByte()// version byte
       
        byte method = dis.readByte();

        if ( method != 0 && method != 2 ){
         
            throw new IOException( "SOCKS 5: no valid method [" + method + "]" );
        }
View Full Code Here

          dos.writeByte( (byte)socks_password.length() ); // password length
          dos.write( socks_password.getBytes() );

          dos.flush();
         
          dis.readByte()// version byte
         
          byte status = dis.readByte();

            if ( status != 0 ){
             
View Full Code Here

          dos.flush();
         
          dis.readByte()// version byte
         
          byte status = dis.readByte();

            if ( status != 0 ){
             
              throw( new IOException( "SOCKS 5: authentication fails [status=" +status+ "]" ));
            }
View Full Code Here

       
        dos.writeShort( (short)delegate.getPort()); // port
       
        dos.flush();
       
        dis.readByte()// ver
       
        byte reply = dis.readByte();
       
        if ( reply != 0 ){
         
View Full Code Here

       
        dos.flush();
       
        dis.readByte()// ver
       
        byte reply = dis.readByte();
       
        if ( reply != 0 ){
         
            throw( new IOException( "SOCKS 5: udp association fails [reply=" +reply+ "]" ));
        }
View Full Code Here

        if ( reply != 0 ){
         
            throw( new IOException( "SOCKS 5: udp association fails [reply=" +reply+ "]" ));
        }
       
        dis.readByte()// reserved
       
        InetAddress  relay_address;
       
        byte atype = dis.readByte();
       
View Full Code Here

       
        dis.readByte()// reserved
       
        InetAddress  relay_address;
       
        byte atype = dis.readByte();
       
        if ( atype == 1 ){
         
          byte[]  bytes = new byte[4];
         
View Full Code Here

         
          relay_address = InetAddress.getByAddress( bytes );
         
        }else if ( atype == 3 ){
         
          byte  len = dis.readByte();
         
          byte[] bytes = new byte[(int)len&0xff ];
         
          dis.readFully( bytes );
         
View Full Code Here

         
          relay_address = InetAddress.getByAddress( bytes );

        }
       
        int  relay_port = ((dis.readByte()<<8)&0xff00) | (dis.readByte() & 0x00ff );
         
        if ( relay_address.isAnyLocalAddress()){
         
          relay_address = control_socket.getInetAddress();
        }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.