Package java.io

Examples of java.io.DataInputStream.available()


    ) throws Exception {
        final KeyStore store = KeyStore.getInstance(keystoreType);
        FileInputStream fis = new FileInputStream(
                "src/test/java/org/apache/cxf/transport/https/resources/" + keystoreFilename);
        DataInputStream dis = new DataInputStream(fis);
        byte[] bytes = new byte[dis.available()];
        dis.readFully(bytes);
        ByteArrayInputStream bin = new ByteArrayInputStream(bytes);
        store.load(bin, keystorePassword.toCharArray());
        for (java.util.Enumeration<String> aliases = store.aliases(); aliases.hasMoreElements();) {
            final String alias = aliases.nextElement();
View Full Code Here


        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

     * @throws IOException if the Streams couldn't be created.
     */
    private static InputStream fullStream(String fname) throws IOException {
        FileInputStream fis = new FileInputStream(fname);
        DataInputStream dis = new DataInputStream(fis);
        byte[] bytes = new byte[dis.available()];
        dis.readFully(bytes);
        ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
        return bais;
    }

View Full Code Here

     * @throws IOException, if the Streams couldn't be created.
     */
    private static InputStream fullStream(String fname) throws IOException {
        FileInputStream fis = new FileInputStream(fname);
        DataInputStream dis = new DataInputStream(fis);
        byte[] bytes = new byte[dis.available()];
        dis.readFully(bytes);
        return new ByteArrayInputStream(bytes);
    }

    public static void doImport(String keystoreName,
View Full Code Here

        FileInputStream fis = null;
        try {
            fis = new FileInputStream(_name);
            DataInputStream dis = new DataInputStream(new BufferedInputStream(fis));

            while (dis.available() > 0) {
                byte[] blob = new byte[(int) dis.readLong()];
                dis.readFully(blob);
                Object object = SerializationHelper.deserialize(blob);
                if (object instanceof StateTransactionLogEntry) {
                    StateTransactionLogEntry state = (StateTransactionLogEntry) object;
View Full Code Here

            // Here BufferedInputStream is added for fast reading.
            bis = new BufferedInputStream(fis);
            dis = new DataInputStream(bis);

            // dis.available() returns 0 if the file does not have more lines.
            while (dis.available() != 0) {
                // this statement reads the line from the file and print it to
                // the console.
                buff.append(dis.readLine()).append("\n");
            }
View Full Code Here

            // Here BufferedInputStream is added for fast reading.
            bis = new BufferedInputStream(fis);
            dis = new DataInputStream(bis);

            // dis.available() returns 0 if the file does not have more lines.
            while (dis.available() != 0) {

                // this statement reads the line from the file and print it to
                // the console.
                buff.append(dis.readLine()).append("\n");
            }
View Full Code Here

    BufferedInputStream bis = new BufferedInputStream(fis);
    DataInputStream dis = new DataInputStream(bis);
    StringBuffer qsb = new StringBuffer();

    // Read the entire query
    while(dis.available() != 0) {
      qsb.append(dis.readLine() + "\n");
    }
    qMap.put(qf.getName(), qsb.toString());
   
    dis.close();
View Full Code Here

            }
    
            // last record
         
            dis.reset();
      len = (int) dis.available() - recOffset[lastIndex];
      dis.skip(recOffset[lastIndex]);    
      bytes = new byte[len];
            dis.readFully(bytes);
            recArray[lastIndex] = new Record(bytes, recAttrs[lastIndex]);
        }
View Full Code Here

    public static Set<SystemPermission> convertSystemPermissions(byte[] systempermissions) {
      ByteArrayInputStream bytes = new ByteArrayInputStream(systempermissions);
      DataInputStream in = new DataInputStream(bytes);
      Set<SystemPermission> toReturn = new HashSet<SystemPermission>();
      try {
        while (in.available() > 0)
          toReturn.add(SystemPermission.getPermissionById(in.readByte()));
      } catch (IOException e) {
        log.error("User database is corrupt; error converting system permissions", e);
        toReturn.clear();
      }
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.