Discards {@code 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)
| 826 | * @throws IOException if an I/O error occurs, or the stream does not support skipping |
| 827 | */ |
| 828 | public static void skipFully(InputStream in, long n) throws IOException { |
| 829 | long skipped = skipUpTo(in, n); |
| 830 | if (skipped < n) { |
| 831 | throw new EOFException( |
| 832 | "reached end of stream after skipping " + skipped + " bytes; " + n + " bytes expected"); |
| 833 | } |
| 834 | } |
| 835 | |
| 836 | /** |
| 837 | * Discards up to {@code n} bytes of data from the input stream. This method will block until |
no test coverage detected