Package java.io

Examples of java.io.DataInputStream.available()


                    ByteArrayInputStream in = new ByteArrayInputStream( buffer );
                    DataInputStream readIn = new DataInputStream( in );

                    do
                    {
                        if ( readIn.available() > 1 )
                        {
                            int size = readIn.readInt();
                            byte[] connectionId = new byte[size];
                            readIn.read( connectionId );
                            connection = BrowserCorePlugin.getDefault().getConnectionManager().getBrowserConnectionById(
View Full Code Here


                            connection = BrowserCorePlugin.getDefault().getConnectionManager().getBrowserConnectionById(
                                new String( connectionId, "UTF-8" ) );
                        }

                        ISearch search = null;
                        if ( readIn.available() > 1 && connection != null )
                        {
                            int size = readIn.readInt();
                            byte[] searchName = new byte[size];
                            readIn.read( searchName );
                            search = connection.getSearchManager().getSearch( new String( searchName, "UTF-8" ) );
View Full Code Here

                        if ( search != null )
                        {
                            searchList.add( search );
                        }
                    }
                    while ( readIn.available() > 1 );

                    readIn.close();
                }
                catch ( IOException ex )
                {
View Full Code Here

        logger.debug("This is a test");
        final DataInputStream is = new DataInputStream(new BufferedInputStream(new FileInputStream(LOGFILE)));
        try {
            int count = 0;
            String str = "";
            while (is.available() != 0) {
                str = is.readLine();
                ++count;
            }
            assertTrue("Incorrect count " + count, count == 1);
            assertTrue("Bad data", str.endsWith("This is a test"));
View Full Code Here

        final Pattern pattern = Pattern.compile(expected);
        final FileInputStream fis = new FileInputStream(FILENAME);
        final DataInputStream is = new DataInputStream(new BufferedInputStream(fis));
        int counter = 0;
        String str = "";
        while (is.available() != 0) {
            str = is.readLine();
            //System.out.println(str);
            ++counter;
            final Matcher matcher = pattern.matcher(str);
            assertTrue("Bad data: " + str, matcher.matches());
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

                ByteArrayInputStream in = new ByteArrayInputStream( buffer );
                DataInputStream readIn = new DataInputStream( in );

                do
                {
                    if ( readIn.available() > 1 )
                    {
                        int size = readIn.readInt();
                        byte[] connectionName = new byte[size];
                        readIn.read( connectionName );
                        IConnection connection = BrowserCorePlugin.getDefault().getConnectionManager().getConnection(
View Full Code Here

                        IConnection connection = BrowserCorePlugin.getDefault().getConnectionManager().getConnection(
                            new String( connectionName ) );
                        connectionList.add( connection );
                    }
                }
                while ( readIn.available() > 1 );

                readIn.close();
            }
            catch ( IOException ex )
            {
View Full Code Here

                    DataInputStream readIn = new DataInputStream( in );

                    do
                    {
                        IConnection connection = null;
                        if ( readIn.available() > 1 )
                        {
                            int size = readIn.readInt();
                            byte[] connectionName = new byte[size];
                            readIn.read( connectionName );
                            connection = BrowserCorePlugin.getDefault().getConnectionManager().getConnection(
View Full Code Here

                            connection = BrowserCorePlugin.getDefault().getConnectionManager().getConnection(
                                new String( connectionName ) );
                        }

                        IEntry entry = null;
                        if ( readIn.available() > 1 && connection != null )
                        {
                            int size = readIn.readInt();
                            byte[] dn = new byte[size];
                            readIn.read( dn );
                            entry = connection.getEntryFromCache( new DN( new String( dn ) ) );
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.