Package java.io

Examples of java.io.DataInputStream.readFully()


       
        if ( atype == 1 ){
         
          byte[]  bytes = new byte[4];
         
          dis.readFully( bytes );
         
          relay_address = InetAddress.getByAddress( bytes );
         
        }else if ( atype == 3 ){
         
View Full Code Here


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

         
        }else{
         
          byte[]  bytes = new byte[16];
         
          dis.readFully( bytes );
         
          relay_address = InetAddress.getByAddress( bytes );

        }
       
View Full Code Here

            if (tmp != null) length = Integer.parseInt(tmp);
         }
         //System.out.println("readBodyContent: Length=" + length);
         byte[] ret = new byte[length];
         DataInputStream in = new DataInputStream(req.getInputStream());
         in.readFully(ret);
         return ret;
      }
      catch (Exception ex) {
         ex.printStackTrace();
         return new byte[0];
View Full Code Here

                KeyManagerFactory.getInstance(keystoreKeyManagerFactoryAlgorithm)
            KeyStore ks = KeyStore.getInstance(keyStoreType);
            FileInputStream fis = new FileInputStream(keyStoreLocation);
            DataInputStream dis = new DataInputStream(fis);
            byte[] bytes = new byte[dis.available()];
            dis.readFully(bytes);
            ByteArrayInputStream bin = new ByteArrayInputStream(bytes);
           
            KeyManager[] keystoreManagers = null;
            if (keyStorePassword != null) {
                try {
View Full Code Here

                    //  Get frame delay
                    long nanos = in.readLong();

                    //  Get frame image
                    byte[] b = new byte[(int)length];
                    in.readFully(b,0,(int)length);
                    ImageIcon icon = new ImageIcon(b);

                    //  Update CachingControl
                    cache.addToProgress(16 + length);
View Full Code Here

                    //  Read in the delay for the frame
                    long nanos = in.readLong();

                    //  Read in the frame image
                    byte[] b = new byte[(int)length];
                    in.readFully(b,0,(int)length);
                    ImageIcon icon = new ImageIcon(b);

                    //  Create a MultiImageFrame object and add to vector
                    MultiImageFrame m = new MultiImageFrame(icon, nanos);
                    frameVector.addElement(m);
View Full Code Here

            long length = stream.getContentLength();

            if( length != SourceStream.LENGTH_UNKNOWN ) {
                //  Load the entire text file into a byte array
                b = new byte[(int)length];
                in.readFully(b,0,(int)length);
            } else {
                System.err.println(
                    "Unknown content length while reading data");

                postEvent(
View Full Code Here

      byte addr[];

      switch(addrType){
         case SOCKS_ATYP_IPV4:
            addr = new byte[4];
            di.readFully(addr);
            host = bytes2IPV4(addr,0);
         break;
         case SOCKS_ATYP_IPV6:
           addr = new byte[SOCKS_IPV6_LENGTH];//I believe it is 16 bytes,huge!
           di.readFully(addr);
View Full Code Here

            di.readFully(addr);
            host = bytes2IPV4(addr,0);
         break;
         case SOCKS_ATYP_IPV6:
           addr = new byte[SOCKS_IPV6_LENGTH];//I believe it is 16 bytes,huge!
           di.readFully(addr);
           host = bytes2IPV6(addr,0);
         break;
         case SOCKS_ATYP_DOMAINNAME:
           //System.out.println("Reading ATYP_DOMAINNAME");
           addr = new byte[di.readUnsignedByte()];//Next byte shows the length
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.