Buffer.clear

Clears this buffer. The position is set to zero, the limit is set to the capacity, and the mark is discarded.

<p> Invoke this method before using a sequence of channel-read or <i>put</i> operations to fill this buffer. For example:

<blockquote><pre> buf.clear(); // Prepare buffer for reading in.read(buf); // Read data</pre></blockquote>

<p> This method does not actually erase the data in the buffer, but it is named as if it did because it will most often be used in situations in which that might as well be the case. </p>

@return This buffer

class Buffer
final
clear
()

Meta