Skips over and discards <code>n</code> bytes of data from the
input stream.
<p>The <code>skip</code> method may, for a variety of
reasons, end up skipping over some smaller number of bytes,
possibly <code>0</code>. If <code>n</code> is negative, the method
will try to skip backwards. In case the backing file does not support
backward skip at its current position, an <code>IOException</code> is
thrown. The actual number of bytes skipped is returned. If it skips
forwards, it returns a positive value. If it skips backwards, it
returns a negative value.
<p>This method may skip more bytes than what are remaining in the
backing file. This produces no exception and the number of bytes skipped
may include some number of bytes that were beyond the EOF of the
backing file. Attempting to read from the stream after skipping past
the end will result in -1 indicating the end of the file.
@param n the number of bytes to be skipped.
@return the actual number of bytes skipped.
@exception IOException if n is negative, if the stream does not
support seek, or if an I/O error occurs.
Skips over and discards <code>n</code> bytes of data from the input stream.
<p>The <code>skip</code> method may, for a variety of reasons, end up skipping over some smaller number of bytes, possibly <code>0</code>. If <code>n</code> is negative, the method will try to skip backwards. In case the backing file does not support backward skip at its current position, an <code>IOException</code> is thrown. The actual number of bytes skipped is returned. If it skips forwards, it returns a positive value. If it skips backwards, it returns a negative value.
<p>This method may skip more bytes than what are remaining in the backing file. This produces no exception and the number of bytes skipped may include some number of bytes that were beyond the EOF of the backing file. Attempting to read from the stream after skipping past the end will result in -1 indicating the end of the file.
@param n the number of bytes to be skipped. @return the actual number of bytes skipped. @exception IOException if n is negative, if the stream does not support seek, or if an I/O error occurs.