Package java.io

Examples of java.io.InputStream.available()


    String acceptValue = req.getHeader("Accept");
    if (acceptValue != null && acceptValue.contains("application/xrds+xml"))
    {
      InputStream is = context.getResourceAsStream("/WEB-INF/discovery.xml");
      byte[] buffer =  new byte[is.available()];
      is.read(buffer, 0, is.available());
      resp.setContentType("application/xrds+xml");
      resp.getOutputStream().write(buffer);
      resp.getOutputStream().flush();
      return;
    }
View Full Code Here


                    fieldName = childEl.getElementName();
                } else {
                    methodName = JdtUtils.getMethodSignature(childEl);
                }
            }
            available = is.available();
            decompiledClass = DecompilerClassVisitor.getDecompiledClass(
                is, fieldName, methodName, modes, cl);
        } catch (Exception e) {
            try {
                // check if compilation unit is ok - then this is the user problem
View Full Code Here

                    final InputStream is = new BufferedInputStream(p.getInputStream());

                    final StringBuilder StringBuilder = new StringBuilder(1024);

                    while (is.available() > 0) {
                        StringBuilder.append((char) is.read());
                    }

                    final String cgiReturn = StringBuilder.toString();
                    int indexOfDelimiter = cgiReturn.indexOf("\n\n");
View Full Code Here

                    + "' is present in .properties file with no value, yet "
                    + "text file resource is missing",
                    RefCapablePropertyResourceBundle.class.getName(), key);
        try {
            try {
                ba = new byte[inputStream.available()];
            } catch (RuntimeException re) {
                throw new MissingResourceException(
                    "Resource is too big to read in '" + key + "' value in one "
                    + "gulp.\nPlease run the program with more RAM "
                    + "(try Java -Xm* switches).: " + re,
View Full Code Here

        DocumentBuilder documentBuilder = getDocumentBuilder();

        try {
            InputStream in = req.getInputStream();
            if (in.available() > 0) {
              Document document = documentBuilder.parse
                  (new InputSource(in));
 
              // Get the root element of the document
              Element rootElement = document.getDocumentElement();
View Full Code Here

        byte[] ba = null;
        int bytesread = 0;
        int retval;
        try {
            try {
                ba = new byte[is.available()];
            } catch (RuntimeException re) {
                throw new IOException(SqltoolRB.read_toobig.getString());
            }
            while (bytesread < ba.length &&
                    (retval = is.read(
View Full Code Here

      FileInputStream datafis = new FileInputStream(filename);
      InputStream buf = new BufferedInputStream(datafis);

      byte[] temp = new byte[1024];
      int length = 0;
      while (buf.available() != 0) {
        length = buf.read(temp);
        sig.update(temp, 0, length);
      }
      buf.close();
View Full Code Here

      int len;
      int size = 1024;

      if (handlerStream instanceof ByteArrayInputStream) {
        size = handlerStream.available();
        buf = new byte[size];
        len = handlerStream.read(buf, 0, size);
      }
      else {
        ByteArrayOutputStream bos = new ByteArrayOutputStream();
View Full Code Here

                InputStream stream = c.getBlobAsStream(0);
                Assert.assertNotNull(stream);
                byte[] blob = null;
                try {
                    blob = new byte[stream.available()];
                    stream.read(blob);
                    stream.close();
                } catch (IOException e) {
                    Assert.fail();
                }
View Full Code Here

                stream = c.getBlobAsStream("a");
                Assert.assertNotNull(stream);
                blob = null;
                try {
                    blob = new byte[stream.available()];
                    stream.read(blob);
                    stream.close();
                } catch (IOException e) {
                    Assert.fail();
                }
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.