nl_tokens: Copy as much of the byte buffer into the output array as possible returning the ( positive ) number of characters copied .
pl_tokens: private int drain ( byte [ ] b , int off , int len ) { int remaining = Math . <mask> ( len , byteBuffer . remaining ( ) ) ; byteBuffer . get ( b , off , remaining ) ; return remaining ; }