Package java.io

Examples of java.io.DataInputStream.available()


        KeyStore ks = KeyStore.getInstance(keyStoreType);
       
        if (keyStoreType.equalsIgnoreCase(PKCS12_TYPE)) {
            FileInputStream fis = new FileInputStream(keyStoreLocation);
            DataInputStream dis = new DataInputStream(fis);
            byte[] bytes = new byte[dis.available()];
            dis.readFully(bytes);
            ByteArrayInputStream bin = new ByteArrayInputStream(bytes);
           
            if (keyStorePassword != null) {
                keystoreManagers = loadKeyStore(kmf,
View Full Code Here


        final int numEntries) throws IOException {
      DataInputStream in = readRootIndex(blk, numEntries);
      // after reading the root index the checksum bytes have to
      // be subtracted to know if the mid key exists.
      int checkSumBytes = blk.totalChecksumBytes();
      if ((in.available() - checkSumBytes) < MID_KEY_METADATA_SIZE) {
        // No mid-key metadata available.
        return;
      }
      midLeafBlockOffset = in.readLong();
      midLeafBlockOnDiskSize = in.readInt();
View Full Code Here

        + "</a></p><br>";

    try {
      FileInputStream file = new FileInputStream(strCaminhoBoletim);
      DataInputStream in = new DataInputStream(file);
      byte[] b = new byte[in.available()];
      in.readFully(b);
      in.close();

      final String result = new String(b, 0, b.length, "ISO-8859-15");
View Full Code Here

    /* Skip OGG page header (length is always 0x1C in this case). */
    input.skip(0x1C);
   
    /* Read Spotify specific data. */
    if(input.read() == 0x81){
      while(input.available() >= 2){
        int blockSize = this.swap(input.readShort());
       
        if(input.available() >= blockSize && blockSize > 0){
          switch(input.read()){
            /* Table lookup */
 
View Full Code Here

    /* Read Spotify specific data. */
    if(input.read() == 0x81){
      while(input.available() >= 2){
        int blockSize = this.swap(input.readShort());
       
        if(input.available() >= blockSize && blockSize > 0){
          switch(input.read()){
            /* Table lookup */
            case 0: {
              if(blockSize == 0x6e){
                this.samples = this.swap(input.readInt());
View Full Code Here

            outputStream.writeInt(msg.capacity());
            outputStream.write(msgArr);
          }
         
          // if currently no message is received and at least 4 bytes are available..
          if(bytesLeftToRead == 0 && inputStream.available() >= 4) {
            System.out.println("reading size of next msg..");
           
            bytesLeftToRead = inputStream.readInt();
            incomingMsg.reset();
          }
View Full Code Here

            bytesLeftToRead = inputStream.readInt();
            incomingMsg.reset();
          }
         
          // Read so many bytes as available or are missing for the message         
          int bytesToRead = Math.min(inputStream.available(), bytesLeftToRead);
          if(bytesToRead > 0) {
            System.out.println("receiving data ("+bytesToRead+" bytes)..");
           
            byte[] buffer = new byte[bytesToRead];
            int bytesActuallyRead = inputStream.read(buffer);
View Full Code Here

      final MediaTracker tracker = new MediaTracker(new JPanel());

      DataInputStream datainputstream = new DataInputStream(
          new FileInputStream(getLocalFile()));

      byte bytes[] = new byte[datainputstream.available()];

      datainputstream.readFully(bytes);
      datainputstream.close();

      Image img = Toolkit.getDefaultToolkit().createImage(bytes);
View Full Code Here

                        final CertificateFactory cf = CertificateFactory.getInstance("X.509");
                       
                        final BufferedInputStream bis = new BufferedInputStream(is) ;
                        final DataInputStream dis = new DataInputStream(bis) ;
                       
                        if (dis.available() > 0)
                        {
                            // We have to skip any preamble to read the certificate
                            do
                            {
                                dis.mark(BEGIN_CERTIFICATE.length() * 2) ;
View Full Code Here

                                {
                                    dis.reset() ;
                                    break ;
                                }
                            }
                            while (dis.available() > 0) ;
                           
                            if (dis.available() > 0)
                            {
                                final X509Certificate cert = (X509Certificate)cf.generateCertificate(dis);
                                certificates.add(cert) ;
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.