Copy bytes from this buffer into the target buffer and compacts this buffer.
<p>
Copy either all bytes written into this buffer (start to current position) or
as many as will fit if the target capacity is less that the bytes written. Bytes
not read from this buffer are moved to the front of the buffer and the position is
reset to the end of the copied region.
@param target
The array to move bytes to from those written into this buffer.
@return the number of bytes transfered to the target buffer.
Copy bytes from this buffer into the target buffer and compacts this buffer. <p> Copy either all bytes written into this buffer (start to current position) or as many as will fit if the target capacity is less that the bytes written. Bytes not read from this buffer are moved to the front of the buffer and the position is reset to the end of the copied region.
@param target The array to move bytes to from those written into this buffer.
@return the number of bytes transfered to the target buffer.