equal
deleted
inserted
replaced
271 * @see java.io.FilterInputStream#in |
271 * @see java.io.FilterInputStream#in |
272 * @see java.io.InputStream#available() |
272 * @see java.io.InputStream#available() |
273 */ |
273 */ |
274 public int available() throws IOException { |
274 public int available() throws IOException { |
275 ensureOpen(); |
275 ensureOpen(); |
276 return (buf.length - pos) + super.available(); |
276 int n = buf.length - pos; |
|
277 int avail = super.available(); |
|
278 return n > (Integer.MAX_VALUE - avail) |
|
279 ? Integer.MAX_VALUE |
|
280 : n + avail; |
277 } |
281 } |
278 |
282 |
279 /** |
283 /** |
280 * Skips over and discards <code>n</code> bytes of data from this |
284 * Skips over and discards <code>n</code> bytes of data from this |
281 * input stream. The <code>skip</code> method may, for a variety of |
285 * input stream. The <code>skip</code> method may, for a variety of |