parse an inputStream that points to an AAINDEX database file

@param inputStream
@throws IOException
761769
public void parse(InputStream inputStream) throws IOException {

		currentMatrix = null;
		currentRows = "";
		currentCols = "";
		max = Short.MIN_VALUE;
		min = Short.MAX_VALUE;
		inMatrix = false;

		BufferedReader buf = new BufferedReader (new InputStreamReader (inputStream));
		String line = null;
		line = buf.readLine();

		while (  line != null ) {

			if ( line.startsWith("//")) {
				finalizeMatrix();
				inMatrix = false;

			} else if ( line.startsWith("H ")){
				// a new matric!
				newMatrix(line);
			} else if ( line.startsWith("D ")) {
				currentMatrix.setDescription(line.substring(2));
			} else if ( line.startsWith("M ")) {
				initMatrix(line);
				inMatrix = true;
			} else if ( line.startsWith("  ")){
				if ( inMatrix)
					processScores(line);
			}

			line = buf.readLine();
		}

	}
222955
void readFrom(InputStream in) throws IOException {
		//TODO could optimize for aligned instances
		final int size = finish - start;
		final int length = (size + 7) >> 3;
		if (length == 0) return;
		int p = size & 7;
		final int q = finish - p;
		if (p != 0) performAdj(SET, q, (long) in.read(), p);
		p = q;
		while (p > start) {
			p -= 8;
			performAdj(SET, p, (long) in.read(), 8);
		}
	}
76963
public Structure parsePDBFile(InputStream inStream)
			throws IOException
	{

		BufferedReader buf = getBufferedReader(inStream);

		return parsePDBFile(buf);

	}
141642
private InputStream parseEntity(DataSource ds) {
        try {
            return ds.getInputStream();
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
596967
public static void parse(SimpleXMLDocHandler doc, InputStream in) throws IOException {
        byte b4[] = new byte[4];
        int count = in.read(b4);
        if (count != 4)
            throw new IOException("Insufficient length.");
        String encoding = getEncodingName(b4);
        String decl = null;
        if (encoding.equals("UTF-8")) {
            StringBuffer sb = new StringBuffer();
            int c;
            while ((c = in.read()) != -1) {
                if (c == '>')
                    break;
                sb.append((char)c);
            }
            decl = sb.toString();
        }
        else if (encoding.equals("CP037")) {
            ByteArrayOutputStream bi = new ByteArrayOutputStream();
            int c;
            while ((c = in.read()) != -1) {
                if (c == 0x6e) // that's '>' in ebcdic
                    break;
                bi.write(c);
            }
            decl = new String(bi.toByteArray(), "CP037");
        }
        if (decl != null) {
            decl = getDeclaredEncoding(decl);
            if (decl != null)
                encoding = decl;
        }
        parse(doc, new InputStreamReader(in, IanaEncodings.getJavaEncoding(encoding)));
    }
927944
public static void read(InputStream stream, byte[] buffer) throws IOException {
        int read = 0;
        while(read < buffer.length) {
            int newlyRead = stream.read(buffer, read, buffer.length - read);
            if(newlyRead == -1)
                throw new EOFException("Attempt to read " + buffer.length
                                       + " bytes failed due to EOF.");
            read += newlyRead;
        }
    }
1207837
public void setData(final InputStream in) throws IOException {
		final byte[] bytes = JKIOUtil.readStream(in);
		setData(bytes);
	}
813698
public static <T> List<T> parseListFrom(final InputStream in, final Schema<T> schema) 
    throws IOException
    {
        int size = in.read();
        if(size == -1)
            return Collections.emptyList();
        
        if(size > 0x7f)
            size = CodedInput.readRawVarint32(in, size);
        
        final ArrayList<T> list = new ArrayList<T>(size);
        final CodedInput input = new CodedInput(in, true);
        for(int i = 0; i < size; i++)
        {
            final T message = schema.newMessage();
            list.add(message);
            schema.mergeFrom(input, message);
            input.checkLastTagWas(0);
        }
        
        assert in.read() == -1;

        return list;
    }
292129
public void handleInputStream(final InputStream is) throws IOException
        {
        LOG.trace("Handling input stream.");
        final OutputStream os = new FileOutputStream(this.m_file);
        try
            {
            final long bytesWritten = org.littleshoot.util.IoUtils.copy(is, os, 
                this.m_writeListener);
            LOG.trace("Wrote "+bytesWritten+" to file: "+this.m_file);
            }
        finally
            {
            IOUtils.closeQuietly(is);
            IOUtils.closeQuietly(os);
            }
        }
203228
@Override
  public void setBinaryStream(int parameterIndex, InputStream inputStream) throws SQLException {
     setBinaryStream(parameterIndex, inputStream, Integer.MAX_VALUE);
  }
986782
private static InputStream inputStreamFromAssets(GraphicFactory graphicFactory, String relativePathPrefix, String src) throws IOException {
        InputStream inputStream = null;
        try {
            inputStream = graphicFactory.platformSpecificSources(relativePathPrefix, src);
        } catch (IOException e) {
        }
        if (inputStream != null) {
            return inputStream;
        }
        return null;
    }
516031
void parseOneFile(final Path inputPath, final Writer outputWriter) throws IOException {
    try (final TFile.Reader.Scanner scanner = this.getScanner(inputPath)) {
      while (!scanner.atEnd()) {
        new LogFileEntry(scanner.entry()).write(outputWriter);
        scanner.advance();
      }
    }
  }
1362110
@Override
    public void read(final InputStream inputStream) throws ConfigurationException, IOException {
        try (Reader reader = new InputStreamReader(inputStream)) {
            read(reader);
        }
    }
829766
public void readAll(InputStream in) throws IOException {
    int read = 0;
    do {
      grow(length);
      read = data.setBytes(length, in, data.length() - length);
      if (read > 0) {
        length += read;
      }
    } while (in.available() > 0);
  }
441727
private void parse(String fileName, @WillClose InputStream stream) throws IOException, SAXException {
        try {
            SAXBugCollectionHandler handler = new SAXBugCollectionHandler(this, new File(fileName));
            XMLReader xr = XMLReaderFactory.createXMLReader();
            xr.setContentHandler(handler);
            xr.setErrorHandler(handler);
            Reader reader = Util.getReader(stream);
            xr.parse(new InputSource(reader));
        } finally {
            Util.closeSilently(stream);
        }
    }
255123
public static void dump(InputStream inputStream) throws IOException
  {
    if(!(inputStream instanceof BufferedInputStream)) {
      inputStream = new BufferedInputStream(inputStream);
    }
    try {
      byte[] buffer = new byte[BUFFER_SIZE];
      int length;
      while((length = inputStream.read(buffer)) != -1) {
        System.out.write(buffer, 0, length);
      }
    }
    finally {
      inputStream.close();
    }
  }
457807
public Object parse(InputStream in) throws ParseException, UnsupportedEncodingException {
		InputStreamReader i2 = new InputStreamReader(in, "utf8");
		return super.parse(i2);
	}