Use limit() instead of capacity()

Change wrappedBuffer(ByteBuffer) to use limit() instead of capacity().
This needs to account for `position()` as well.

Also, the javadoc needs to be updated.