nl_tokens: copies exactly data . length bytes from this SegmentedByteArray into the provided byte array
pl_tokens: public int copy ( long srcPos , byte [ ] data , int destPos , int length ) { int segmentSize = 1 << log2OfSegmentSize ; int remainingBytesInSegment = ( int ) ( segmentSize - ( srcPos & bitmask ) ) ; int dataPosition = destPos ; while ( length > 0 ) { byte [ ] segment = segments [ ( int ) ( srcPos >>> log2OfSegmentSize ) ] ; int bytesToCopyFromSegment = Math . <mask> ( remainingBytesInSegment , length ) ; System . arraycopy ( segment , ( int ) ( srcPos & bitmask ) , data , dataPosition , bytesToCopyFromSegment ) ; dataPosition += bytesToCopyFromSegment ; srcPos += bytesToCopyFromSegment ; remainingBytesInSegment = segmentSize - ( int ) ( srcPos & bitmask ) ; length -= bytesToCopyFromSegment ; } return dataPosition - destPos ; }