# This patch file was generated by NetBeans IDE # This patch can be applied using context Tools: Apply Diff Patch action on respective folder. # It uses platform neutral UTF-8 encoding. # Above lines and this line are ignored by the patching process. Index: openide/fs/src/org/openide/filesystems/MIMESupport.java --- openide/fs/src/org/openide/filesystems/MIMESupport.java Base (1.21) +++ openide/fs/src/org/openide/filesystems/MIMESupport.java Locally Modified (Based On 1.21) @@ -518,6 +518,36 @@ internalClose(); } + @Override + public int read(byte[] b, int off, int blen) throws IOException { + int retval = -1; + if (!eof) { + boolean isCached = (pos + blen < len); + if (isCached) { + retval = blen; + } else { + int buflen = Math.max(len, blen); + buflen = (buflen > 0) ? (buflen * 2) : 256; + byte[] buf = new byte[buflen]; + if (len > 0) { + System.arraycopy(buffer, 0, buf, 0, len); + } + final int reuiredLen = buflen - blen; + int c = inputStream.read(buf, len, reuiredLen); + buffer = buf; + len += (c > 0) ? c : 0; + eof = (c < reuiredLen) ? true : false; + retval = Math.min(c, blen); + } + if (retval > 0) { + System.arraycopy(buffer, pos, b, off, retval); + pos += retval; + } + } + return retval; + } + + public int read() throws IOException { if (eof) { return -1;