int length = ptr.getLength();
    if (length == 0) { // means null
        nNulls++;
    } else {
        if (nNulls > 0) {
            oStream.write(QueryConstant.SEPARATOR_BYTE);
            do {
                byte nNullsWritten = (byte)(nNulls % 256);
                oStream.write(nNullsWritten); // Single byte for repeating nulls
                nNulls -= nNullsWritten;
            } while (nNulls > 0);
    }