no need to call clear(). use flip() instead of calling limit(), position() and rewind().