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)
| 783 | |
| 784 | |
| 785 | public static void skipFully(InputStream in, long n) throws IOException { |
| 786 | long skipped = skipUpTo(in, n); |
| 787 | if (skipped < n) { |
| 788 | throw new EOFException("reached end of stream after skipping " + skipped + " bytes; " + n |
| 789 | + " bytes expected"); |
| 790 | } |
| 791 | } |
| 792 | |
| 793 | /** |
| 794 | * Discards up to {@code n} bytes of data from the input stream. This method will block until |