Discards the initial portion of the stream prior to the indicated position. Attempting to seek to an offset within the flushed portion of the stream will result in an
IndexOutOfBoundsException
.
Calling flushBefore
may allow classes implementing this interface to free up resources such as memory or disk space that are being used to store data from the stream.
@param pos a long
containing the length of thestream prefix that may be flushed.
@exception IndexOutOfBoundsException if pos
liesin the flushed portion of the stream or past the current stream position.
@exception IOException if an I/O error occurs.