Code example for ByteArrayInputStream

Methods: close

            Log.logWarning("opensearchdescriptionReader", "response incomplete"); 
            return null; 
        // make input stream 
        final ByteArrayInputStream bais = new ByteArrayInputStream(a);
        // parse stream 
        opensearchdescriptionReader reader = null;
        try { 
            reader = new opensearchdescriptionReader(bais);
        } catch (final Exception e) {
            Log.logWarning("opensearchdescriptionReader", "parse exception: " + e);
            return null; 
        try { bais.close(); } catch (final IOException e) {}
        return reader;
    public void startElement(final String uri, final String name, final String tag, final Attributes atts) throws SAXException {
Connect your IDE to all the code out there  Get Codota for Java