Handles the cases in which we can use longs rather than BigInteger

@param section
@param increment
@param addrCreator
@param lowerProducer
@param upperProducer
@param prefixLength
@return
486579
protected static <R extends AddressSection, S extends AddressSegment> R fastIncrement(
			R section,
			long increment,
			AddressCreator<?, R, ?, S> addrCreator, 
			Supplier<R> lowerProducer,
			Supplier<R> upperProducer,
			Integer prefixLength) {
		if(increment >= 0) {
			BigInteger count = section.getCount();
			if(count.compareTo(LONG_MAX) <= 0) {
				long longCount = count.longValue();
				if(longCount > increment) {
					if(longCount == increment + 1) {
						return upperProducer.get();
					}
					return incrementRange(section, increment, addrCreator, lowerProducer, prefixLength);
				}
				BigInteger value = section.getValue();
				BigInteger upperValue;
				if(value.compareTo(LONG_MAX) <= 0 && (upperValue = section.getUpperValue()).compareTo(LONG_MAX) <= 0) {
					return increment(
							section,
							increment,
							addrCreator,
							count.longValue(),
							value.longValue(),
							upperValue.longValue(),
							lowerProducer,
							upperProducer,
							prefixLength);
				}
			}
		} else {
			BigInteger value = section.getValue();
			if(value.compareTo(LONG_MAX) <= 0) {
				return add(lowerProducer.get(), value.longValue(), increment, addrCreator, prefixLength);
			}
		}
		return null;
	}
468704
public static long readLong(ArrayView source, int position) {
        return (long) (source.get(position) & 0xFF) << 56
                | (long) (source.get(position + 1) & 0xFF) << 48
                | (long) (source.get(position + 2) & 0xFF) << 40
                | (long) (source.get(position + 3) & 0xFF) << 32
                | (long) (source.get(position + 4) & 0xFF) << 24
                | (source.get(position + 5) & 0xFF) << 16
                | (source.get(position + 6) & 0xFF) << 8
                | (source.get(position + 7) & 0xFF);
    }
643908
synchronized void setLength(long length) {
        Preconditions.checkState(!this.sealed, "Cannot increase the length of a sealed SegmentChunk.");
        Preconditions.checkArgument(length >= 0, "length must be a non-negative number.");
        this.length = length;
    }
837704
@SuppressWarnings("checkstyle:magicnumber")
    void writeLong(long value) {
        if (value == Long.MIN_VALUE) {
            write(STR_LONG_MIN_VALUE);
            return;
        }

        if (value < 0) {
            write('-');
            value = -value;
        }

        int digitsWithoutComma = 0;
        tmpSb.setLength(0);
        do {
            digitsWithoutComma++;
            if (digitsWithoutComma == 4) {
                tmpSb.append(',');
                digitsWithoutComma = 1;
            }

            int mod = (int) (value % 10);
            tmpSb.append(DIGITS[mod]);
            value = value / 10;
        } while (value > 0);

        for (int k = tmpSb.length() - 1; k >= 0; k--) {
            char c = tmpSb.charAt(k);
            write(c);
        }
    }
704047
MutableNode splitKey(final int prefixLength, final byte nextByte) {
        final byte[] keyBytes = keySequence.getBytesUnsafe();
        final ByteIterable prefixKey;
        if (prefixLength == 0) {
            prefixKey = ByteIterable.EMPTY;
        } else if (prefixLength == 1) {
            prefixKey = SingleByteIterable.getIterable(keyBytes[0]);
        } else {
            prefixKey = new ArrayByteIterable(keyBytes, prefixLength);
        }
        final MutableNode prefix = new MutableNode(prefixKey);
        final int suffixLength = keySequence.getLength() - prefixLength - 1;
        final ByteIterable suffixKey;
        if (suffixLength == 0) {
            suffixKey = ByteIterable.EMPTY;
        } else if (suffixLength == 1) {
            suffixKey = SingleByteIterable.getIterable(keyBytes[prefixLength + 1]);
        } else {
            suffixKey = keySequence.subIterable(prefixLength + 1, suffixLength);
        }
        final MutableNode suffix = new MutableNode(suffixKey, value,
                // copy children of this node to the suffix one
                children);
        prefix.setChild(nextByte, suffix);
        return prefix;
    }
805344
static Long[] createLongs() {
        int len = LONG_UPPER_BOUND - LONG_LOWER_BOUND + 1;
        Long[] ret = new Long[len];
        long val = (long) LONG_LOWER_BOUND;
        for (int i = 0; i < len; i++, val++) {
            ret[i] = new Long(val);
        }
        return ret;
    }
568166
private static boolean needIncrement(long ldivisor, int roundingMode,
                                         int qsign, MutableBigInteger mq, long r) {
        assert r != 0L;

        int cmpFracHalf;
        if (r <= HALF_LONG_MIN_VALUE || r > HALF_LONG_MAX_VALUE) {
            cmpFracHalf = 1; // 2 * r can't fit into long
        } else {
            cmpFracHalf = longCompareMagnitude(2 * r, ldivisor);
        }

        return commonNeedIncrement(roundingMode, qsign, cmpFracHalf, mq.isOdd());
    }
645007
public void checkSkipReadForFixLengthPart(AbstractPagedInputView source) throws IOException {
		// skip if there is no enough size.
		// Note: Use currentSegmentLimit instead of segmentSize.
		int available = source.getCurrentSegmentLimit() - source.getCurrentPositionInSegment();
		if (available < getSerializedRowFixedPartLength()) {
			source.advance();
		}
	}
95706
static public int writeTypeDescWithLength(OutputStream userstream, int typeid, int lenOfLength, int valueLength) throws IOException
    {
        int written_len = 1;

        int td = ((typeid & 0xf) << 4);
        if (valueLength >= _Private_IonConstants.lnIsVarLen) {
            td |= _Private_IonConstants.lnIsVarLen;
            userstream.write((byte)(td & 0xff));
            written_len += writeVarUInt(userstream, (long)valueLength, lenOfLength, true);
        }
        else {
            td |= (valueLength & 0xf);
            userstream.write((byte)(td & 0xff));
        }
        return written_len;
    }
660062
public static long nextLong(long n) {
        // error checking and 2^x checking removed for simplicity.
        long bits, val;
        do {
            bits = (RND.nextLong() << 1) >>> 1;
            val = bits % n;
        } while (bits-val+(n-1) < 0L);
        return val;
    }
76367
protected Long addLongValue(Object name, long inc) {
    Long val = this.longCounters.get(name);
    Long retv = null;
    if (val == null) {
      retv = new Long(inc);
    } else {
      retv = new Long(val.longValue() + inc);
    }
    this.longCounters.put(name, retv);
    return retv;
  }
1095911
static long toLong(final byte[] buffer, final int offset) {
        final long value1 = toInt(buffer, offset);
        final long value2 = toInt(buffer, offset + 4);
        return (value1 << 32) + ((value2 << 32) >>> 32);
    }
523176
public void setLongProperty(String pstrSection, String pstrProp, 
                    			long plngVal, String pstrComments)
    {
        INISection objSec   = null;

        objSec = (INISection) this.mhmapSections.get(pstrSection);
        if (objSec == null)
        {
            objSec = new INISection(pstrSection);
            this.mhmapSections.put(pstrSection, objSec);
        }
        objSec.setProperty(pstrProp, Long.toString(plngVal), pstrComments);
    }
420944
public static void writeLongLittleEndian(IO.WritableByteStream io, long value) throws IOException {
		io.write((byte)(value & 0xFF));
		io.write((byte)((value >> 8) & 0xFF));
		io.write((byte)((value >> 16) & 0xFF));
		io.write((byte)((value >> 24) & 0xFF));
		io.write((byte)((value >> 32) & 0xFF));
		io.write((byte)((value >> 40) & 0xFF));
		io.write((byte)((value >> 48) & 0xFF));
		io.write((byte)((value >> 56) & 0xFF));
	}
334823
private Item newLong(final long value) {
        Item result = get(key.set(LONG, value));
        if (result == null) {
            pool.putByte(LONG).putLong(value);
            result = new Item(poolIndex, key);
            put(result);
            poolIndex += 2;
        }
        return result;
    }
191982
static int sharedPrefixLength(ByteBuffer a, int aStart, ByteBuffer b, int bStart) {
    int i = 0;
    final int max = Math.min(a.remaining() - aStart, b.remaining() - bStart);
    aStart += a.position();
    bStart += b.position();
    while (i < max && a.get(aStart++) == b.get(bStart++)) {
      i++;
    }
    return i;
  }
623087
private void writeRun(final int value, int runLength) {
        final int blockLength = this.blockLength;
        final byte[] block = this.block;

        blockValuesPresent[value] = true;
        crc.updateCRC(value, runLength);

        final byte byteValue = (byte) value;
        switch (runLength) {
            case 1:
                block[blockLength] = byteValue;
                this.blockLength = blockLength + 1;
                break;
            case 2:
                block[blockLength] = byteValue;
                block[blockLength + 1] = byteValue;
                this.blockLength = blockLength + 2;
                break;
            case 3:
                block[blockLength] = byteValue;
                block[blockLength + 1] = byteValue;
                block[blockLength + 2] = byteValue;
                this.blockLength = blockLength + 3;
                break;
            default:
                runLength -= 4;
                blockValuesPresent[runLength] = true;
                block[blockLength] = byteValue;
                block[blockLength + 1] = byteValue;
                block[blockLength + 2] = byteValue;
                block[blockLength + 3] = byteValue;
                block[blockLength + 4] = (byte) runLength;
                this.blockLength = blockLength + 5;
                break;
        }
    }