Package java.io

Examples of java.io.InputStream.available()


  if (is == null) {
      return null;
  }

  try {
      byte[] buf = new byte[is.available()];

      is.read(buf);
      return new String(buf);
  } catch (IOException e) {
      logger.log(Level.WARNING, "Unable to read softphone build date", e);
View Full Code Here


    try {
      InputStream is = getFile(base, name);
      if (is==null) return null;

      byte[] buf = new byte[is.available()];
      is.read(buf);
      return buf;
    } catch (IOException e) {
      e.printStackTrace();
      throw new ExceptionInInitializerError("Error loading "+name+":"+e.getMessage());
View Full Code Here

    try {
      InputStream is = getFile(base, name);
      if (is==null) return null;

      byte[] buf = new byte[is.available()];
      is.read(buf);
      return buf;
    } catch (IOException e) {
      e.printStackTrace();
      throw new ExceptionInInitializerError("Error loading "+name+":"+e.getMessage());
View Full Code Here

        }
        InputStream is = null;
        try {
            is = servletConfig.getServletContext().getResourceAsStream(location);
           
            if (is == null || is.available() == -1) {
                URIResolver resolver = new URIResolver(location);

                if (resolver.isResolved()) {
                    is = resolver.getInputStream();
                }
View Full Code Here

            add_invalid_ok2 = true;
        }

        InputStream is1 = server1.getInputStream();
        Thread.sleep(1000);
        if(is1.available() == 0)
        {
            connect1_ok = true;
        }

        Thread.sleep(1000);
View Full Code Here

            connect1_ok = true;
        }

        Thread.sleep(1000);
        InputStream is2 = server2.getInputStream();
        if(is2.available() == 9)
        {
            is2.read(buffread2);
            connect2_ok = true;

            if(equalBytes(buffread2, expected2))
View Full Code Here

                 init2_ok = true;
        }

        InputStream is3 = server3.getInputStream();
        Thread.sleep(1000);
        if(is3.available() == 0)
        {
            connect3_ok = true;
        }

        closeConnections();
View Full Code Here

        openConnections();

        InputStream is1 = server1.getInputStream();
        OutputStream os1 = server1.getOutputStream();
        is1.skip(is1.available());
        os1.write(send1);
        os1.flush();
        Thread.sleep(1000);
        if(is1.available() == 6)
        {
View Full Code Here

        OutputStream os1 = server1.getOutputStream();
        is1.skip(is1.available());
        os1.write(send1);
        os1.flush();
        Thread.sleep(1000);
        if(is1.available() == 6)
        {
            is1.read(buffread1);

            if(equalBytes(buffread1, expected1))
                negotiation1_ok = true;
View Full Code Here

        }

        InputStream is2 = server2.getInputStream();
        OutputStream os2 = server2.getOutputStream();
        Thread.sleep(1000);
        is2.skip(is2.available());
        os2.write(send2);
        os2.flush();
        Thread.sleep(1000);
        if(is2.available() == 9)
        {
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.