app/src/main/java/org/jfet/batsM3u/M3uPlay.java
// take an input stream and turn it into a string
take an input stream and turn it into a string
take an input stream and turn it into a string
static String istrm2String(InputStream in) {
        final StringBuilder sb = new StringBuilder();
        final char[] buffer = new char[bufSize];
        int nRead;
        try {
            final InputStreamReader inRd = new InputStreamReader(in,"UTF-8");
            try {
                while (true) {
                    nRead = inRd.read(buffer);
                    if (nRead < 0)
                        break;
                    sb.append(buffer,0,nRead);
                }
            } finally {
                inRd.close();
                in.close();
            }
        } catch (IOException ex) {
            return "";
        }
        return sb.toString();
    }
static String istrm2String ( InputStream in ) { final StringBuilder sb = new StringBuilder ( ) ; final char [ ] buffer = new char [ bufSize ] ; int nRead ; try { final InputStreamReader inRd = new InputStreamReader ( in , "UTF-8" ) ; try { while ( true ) { nRead = inRd . read ( buffer ) ; if ( nRead < 0 ) break ; sb . append ( buffer , 0 , nRead ) ; } } finally { inRd . close ( ) ; in . close ( ) ; } } catch ( IOException ex ) { return "" ; } return sb . toString ( ) ; }
take an input stream and turn it into a string
take an input stream and turn it into a string