public static int computeListSize(int order, List list, FieldType type, boolean debug, File path, boolean packed,
            boolean sizeOnly) {
        int size = 0;
        if (list == null || list.isEmpty()) {
            return size;
        }

        int dataSize = 0;
        for (Object object : list) {
            dataSize += computeSize(order, object, type, debug, path);
        }
        size += dataSize;
        if (type != FieldType.OBJECT) {
            if (packed) {
                if (!sizeOnly) {
                    size += com.google.protobuf.CodedOutputStream.computeInt32SizeNoTag(dataSize);
                    int tag = CodedConstant.makeTag(order,
                            WireFormat.WIRETYPE_LENGTH_DELIMITED);
                    size += com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(tag);
                }
            } else {
                size += list.size() * CodedOutputStream.computeTagSize(order);
            }
        }
        return size;
    }
public static int computeListSize ( int order , List list , FieldType type , boolean debug , File path , boolean packed , boolean sizeOnly ) { int size = 0 ; if ( list == null || list . isEmpty ( ) ) { return size ; } int dataSize = 0 ; for ( Object object : list ) { dataSize += computeSize ( order , object , type , debug , path ) ; } size += dataSize ; if ( type != FieldType . OBJECT ) { if ( packed ) { if ( ! sizeOnly ) { size += com . google . protobuf . CodedOutputStream . computeInt32SizeNoTag ( dataSize ) ; int tag = CodedConstant . makeTag ( order , WireFormat . WIRETYPE_LENGTH_DELIMITED ) ; size += com . google . protobuf . CodedOutputStream . computeUInt32SizeNoTag ( tag ) ; } } else { size += list . size ( ) * CodedOutputStream . computeTagSize ( order ) ; } } return size ; }
Compute list size.

@param order the order
@param list the list
@param type the type
@param debug the debug
@param path the path
@param packed the packed
@param sizeOnly the size only if true will not include order size and tag size
@return the int