question: private int freeSpace ( ) { return buffer . capacity ( ) - buffer . limit ( ) + buffer . position ( ) ; }
target:  Return the size of free space in a buffer. E.g. Given a buffer with pointers 0 <= position <= limit <= capacity, E.g. Buffer: | 0, 0, 1, 2, 3, 4, 0, 0, 0, 0, 0 | |     |        |              | 0  position  limit         capacity This method returns capacity - limit + position