src/main/java/com/googlecode/javaewah32/IteratingBufferedRunningLengthWord32.java
public int dischargeNegated(BitmapStorage32 container, int max) {
        int index = 0;
        while ((index < max) && (size() > 0)) {
            // first run
            int pl = getRunningLength();
            if (index + pl > max) {
                pl = max - index;
            }
            container.addStreamOfEmptyWords(!getRunningBit(), pl);
            index += pl;
            int pd = getNumberOfLiteralWords();
            if (pd + index > max) {
                pd = max - index;
            }
            writeNegatedLiteralWords(pd, container);
            discardFirstWords(pl + pd);
            index += pd;
        }
        return index;
    }
public int dischargeNegated(BitmapStorage32 container, int max) {
        int index = 0;
        while ((index < max) && (size() > 0)) {
            // first run
            int pl = getRunningLength();
            if (index + pl > max) {
                pl = max - index;
            }
            container.addStreamOfEmptyWords(!getRunningBit(), pl);
            index += pl;
            int pd = getNumberOfLiteralWords();
            if (pd + index > max) {
                pd = max - index;
            }
            writeNegatedLiteralWords(pd, container);
            discardFirstWords(pl + pd);
            index += pd;
        }
        return index;
    }
public int dischargeNegated ( BitmapStorage32 container , int max ) { int index = 0 ; while ( ( index < max ) && ( size ( ) > 0 ) ) { // first run int pl = getRunningLength ( ) ; if ( index + pl > max ) { pl = max - index ; } container . addStreamOfEmptyWords ( ! getRunningBit ( ) , pl ) ; index += pl ; int pd = getNumberOfLiteralWords ( ) ; if ( pd + index > max ) { pd = max - index ; } writeNegatedLiteralWords ( pd , container ) ; discardFirstWords ( pl + pd ) ; index += pd ; } return index ; }
Write out up to max words (negated), returns how many were written

@param container target for writes
@param max       maximal number of writes
@return how many written
Write out up to max words ( negated ) returns how many were written