Code example for BufferedInputStream

Methods: closeread

0
 
            //we get the XML as a String 
            final byte[] buffer = new byte[(int) catalogFile.length()];
            BufferedInputStream in = null;
            try { 
                in = new BufferedInputStream(new FileInputStream(catalogFile));
                in.read(buffer);
 
            } finally { 
                if (in != null)
                    try { 
                        in.close();
                    } catch (final IOException ignored) {
                    } 
            } 
            final String xml = new String(buffer);
            return xml;
        } else { 
            throw new IllegalAccessException();
        } 
Stop searching for code, let great code find you!  Add Codota to your java IDE