Package java.io

Examples of java.io.BufferedInputStream.available()


    {
      Resource r = agentServices.requestResource(this.url, false);
      InputStream in = new BufferedInputStream(r.getInputStream());

      // read all data
      this.payload = new byte[in.available()];
      in.read(this.payload);

      // even if we failed, we have no other option
      return;
    }
View Full Code Here


            if (!_accessFilePermitted((File) src, FILE_READ)) {
                throw new IOException("src path " + ((File) src).getAbsolutePath() + " is not readeable/doesn't exist");
            }
        } else {
            if (JXAenvUtils._debugSys) {
                System.out.println("file copy " + (connection instanceof URLConnection ? connection.getContentLength() : JXAextensionStream.available()) + " -> " + dst.getAbsolutePath());
            }
        }
        if (dst.getParentFile() != null) {
            dst.getParentFile().mkdirs();
            _makeWritable(dst.getParentFile());
View Full Code Here

                    ps.println(JXAenvUtils.log("New Console input has been created.", JXAenvUtils.LVL.APP_NOT));
                    Formatter f = new Formatter(ps);
                    byte[] s = new byte[128];
                    int r;
                    do {
                        while (_in.available() <= 0) {
                            Thread.sleep(250);
                        }
                        if ((r = _in.read(s)) != -1) {
                            byte[] rB = new byte[r];
                            for (int i = 0; i < r; i++) {
View Full Code Here

                        }
                        if (stop) {
                            break;
                        }
                        /** wait loop available bytes*/
                        while (pis.available() <= 0) {
                            Thread.sleep(250);
                        }
                        /** read and apped to console buffer (cache)*/
                        if ((r = pis.read(b)) != -1) {
                            byte[] rB = new byte[r];
View Full Code Here

            public void process(Exchange exchange) throws Exception {
                // Read from an input stream
                InputStream is = new BufferedInputStream(
                        new FileInputStream("./src/test/resources/test.txt"));

                byte buffer[] = new byte[is.available()];
                int n = is.available();
                for (int i = 0; i < n; i++) {
                    buffer[i] = (byte) is.read();
                }
View Full Code Here

                // Read from an input stream
                InputStream is = new BufferedInputStream(
                        new FileInputStream("./src/test/resources/test.txt"));

                byte buffer[] = new byte[is.available()];
                int n = is.available();
                for (int i = 0; i < n; i++) {
                    buffer[i] = (byte) is.read();
                }

                is.close();
View Full Code Here

            public void process(Exchange exchange) throws Exception {
                // Read from an input stream
                InputStream is = new BufferedInputStream(
                        new FileInputStream("./src/test/resources/asf-logo.gif"));

                byte buffer[] = new byte[is.available()];
                int n = is.available();
                for (int i = 0; i < n; i++) {
                    buffer[i] = (byte) is.read();
                }
View Full Code Here

                // Read from an input stream
                InputStream is = new BufferedInputStream(
                        new FileInputStream("./src/test/resources/asf-logo.gif"));

                byte buffer[] = new byte[is.available()];
                int n = is.available();
                for (int i = 0; i < n; i++) {
                    buffer[i] = (byte) is.read();
                }

                is.close();
View Full Code Here

            public void process(Exchange exchange) throws Exception {
                // Read from an input stream
                InputStream is = new BufferedInputStream(
                        new FileInputStream("./src/test/resources/asf-logo.JPG"));

                byte buffer[] = new byte[is.available()];
                int n = is.available();
                for (int i = 0; i < n; i++) {
                    buffer[i] = (byte) is.read();
                }
View Full Code Here

                // Read from an input stream
                InputStream is = new BufferedInputStream(
                        new FileInputStream("./src/test/resources/asf-logo.JPG"));

                byte buffer[] = new byte[is.available()];
                int n = is.available();
                for (int i = 0; i < n; i++) {
                    buffer[i] = (byte) is.read();
                }

                is.close();
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.