nl_tokens: Write out up to max words returns how many were written
pl_tokens: public int discharge ( BitmapStorage32 container , int <mask> ) { int index = 0 ; while ( true ) { if ( index + getRunningLength ( ) > max ) { final int offset = max - index ; container . addStreamOfEmptyWords ( getRunningBit ( ) , offset ) ; this . brlw . RunningLength -= offset ; return max ; } container . addStreamOfEmptyWords ( getRunningBit ( ) , getRunningLength ( ) ) ; index += getRunningLength ( ) ; if ( getNumberOfLiteralWords ( ) + index > max ) { final int offset = max - index ; writeLiteralWords ( offset , container ) ; this . brlw . RunningLength = 0 ; this . brlw . NumberOfLiteralWords -= offset ; this . literalWordStartPosition += offset ; return max ; } writeLiteralWords ( getNumberOfLiteralWords ( ) , container ) ; index += getNumberOfLiteralWords ( ) ; if ( ! next ( ) ) break ; } return index ; }