Discards n bytes of data from the input stream. This method will block until the full amount has been skipped. Does not close the stream. @param in the input stream to read from @param n the number of bytes to skip @throws EOFException if this stream reaches the end before skipping all the
(InputStream in, long n)
| 753 | * @throws IOException if an I/O error occurs, or the stream does not support skipping |
| 754 | */ |
| 755 | public static void skipFully(InputStream in, long n) throws IOException { |
| 756 | long skipped = skipUpTo(in, n); |
| 757 | if (skipped < n) { |
| 758 | throw new EOFException( |
| 759 | "reached end of stream after skipping " + skipped + " bytes; " + n + " bytes expected"); |
| 760 | } |
| 761 | } |
| 762 | |
| 763 | /** |
| 764 | * Discards up to {@code n} bytes of data from the input stream. This method will block until |