Package java.io

Examples of java.io.DataInputStream.available()


                int len = in.readInt();
                byte[] tuple = new byte[len];
                in.read(tuple);
                tuples.add(tuple);
            }
            if(in.available() > 0) {
                throw new IllegalStateException(in.available() + " bytes left");
            }
            this.totalDataLen = v.getLength();
            this.loaded = true;
        }
View Full Code Here


                byte[] tuple = new byte[len];
                in.read(tuple);
                tuples.add(tuple);
            }
            if(in.available() > 0) {
                throw new IllegalStateException(in.available() + " bytes left");
            }
            this.totalDataLen = v.getLength();
            this.loaded = true;
        }
View Full Code Here

            KeyManagerFactory kmf =
                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) {
View Full Code Here

        StringBuffer tmp = new StringBuffer(200) ;
        DataInputStream r = new DataInputStream(input) ;
        while (! parent.finished) {

          sleep(10);
          while (r.available() > 0) {

            int b = r.readUnsignedByte() ;
            if (b != '\r') {

              if (b == '\n') {
View Full Code Here

     */
    private static InputStream getStream(String fileName) throws Exception {

        FileInputStream fis = new FileInputStream(fileName);
        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

            byte[] hintedBytes = message.getHeader(RowMutation.HINT);
            if (hintedBytes != null)
            {
                assert hintedBytes.length > 0;
                DataInputStream dis = new DataInputStream(new ByteArrayInputStream(hintedBytes));
                while (dis.available() > 0)
                {
                    ByteBuffer addressBytes = ByteBufferUtil.readWithShortLength(dis);
                    if (logger_.isDebugEnabled())
                        logger_.debug("Adding hint for " + InetAddress.getByName(ByteBufferUtil.string(addressBytes)));
                    RowMutation hintedMutation = new RowMutation(Table.SYSTEM_TABLE, addressBytes);
View Full Code Here

        List<Versioned<byte[]>> returnList = new ArrayList<Versioned<byte[]>>();
        ByteArrayInputStream stream = new ByteArrayInputStream(values);
        DataInputStream dataStream = new DataInputStream(stream);

        while(dataStream.available() > 0) {
            byte[] object = new byte[dataStream.readInt()];
            dataStream.read(object);

            byte[] clockBytes = new byte[dataStream.readInt()];
            dataStream.read(clockBytes);
View Full Code Here

            else if (packetType == PART_REDSTONE_STATE)
            {
                byte[] oldRsArray = this.rsArray;
                byte[] oldIrsArray = this.irsArray;
               
                while (ds.available() > 1)
                {
                    try
                    {
                        byte freq = ds.readByte();
                        if (freq >= RS_FIRST && freq <= RS_LAST)
View Full Code Here

        // Find "FTX" marker at beginning of metrics
        buf = "";
        do {
            buf += (char) in.read();
        } while (in.available() > 0 && !buf.endsWith("FTX"));

        // Throw an exception if we couldn't find the marker
        if (!buf.endsWith("FTX")) {
            in.close();
            throw new Exception(
View Full Code Here

        // Initialise the metrics array
        metrics = new GlyphMetrics[127];

        // Read each glyphs metrics
        while (in.available() > 0) {
            c = in.read();
            x = in.readInt();
            y = in.readInt();
            w = in.read();
            h = in.read();
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.