<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p><br>
</p>
<p>Looking at the BufferedInputStream impl, it looks like its
skip(...) method should trigger the internal array to be refilled
when the internal bytes are used up. Maybe something like below
would also work?<br>
</p>
<pre> while (n > 0) {
int n2 = skip(n);
if (n2 == 0) {<span class="changed">
throw new IOException("Premature EOF reached");
} else {
n -= n2;
}
}
</span></pre>
<p>Valerie<br>
</p>
<p><br>
</p>
<br>
<div class="moz-cite-prefix">On 4/24/2018 7:42 AM, Weijun Wang
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:75DD716E-82A1-4160-A057-90735DC38147@oracle.com">
<pre wrap="">Please take a review at
<a class="moz-txt-link-freetext" href="http://cr.openjdk.java.net/~weijun/8201867/webrev.00/">http://cr.openjdk.java.net/~weijun/8201867/webrev.00/</a>
When the hole in keytab is right on the 8192 buffer boundary, skip(n) does not return n.
I are not sure if I can do something like "while (i < n) i += skip(n)" because skip(n) can return zero and it does not understand EOF. Therefore I readNBytes(n) and discard the result. If you have a better solution, I'll be happy to know.
Thanks
Max
</pre>
</blockquote>
<br>
</body>
</html>