1515import java .util .Vector ;
1616
1717class UploadInfoV2 extends UploadInfo {
18- private final static String TypeKey = "infoType" ;
19- private final static String TypeValue = "UploadInfoV2" ;
20- private final static int maxDataSize = 1024 * 1024 * 1024 ;
18+ private static final String TypeKey = "infoType" ;
19+ private static final String TypeValue = "UploadInfoV2" ;
20+ private static final int maxDataSize = 1024 * 1024 * 1024 ;
21+ private static final int DataListCapacityIncrement = 2 ;
2122
2223 private final int dataSize ;
2324 private List <UploadData > dataList ;
@@ -38,7 +39,7 @@ private UploadInfoV2(UploadSource source, int dataSize, List<UploadData> dataLis
3839 UploadInfoV2 (UploadSource source , Configuration configuration ) {
3940 super (source );
4041 this .dataSize = Math .min (configuration .chunkSize , maxDataSize );
41- this .dataList = new Vector <>(2 , 2 );
42+ this .dataList = new Vector <>(DataListCapacityIncrement , DataListCapacityIncrement );
4243 }
4344
4445 static UploadInfoV2 infoFromJson (UploadSource source , JSONObject jsonObject ) {
@@ -57,7 +58,7 @@ static UploadInfoV2 infoFromJson(UploadSource source, JSONObject jsonObject) {
5758 expireAt = jsonObject .getLong ("expireAt" );
5859 uploadId = jsonObject .optString ("uploadId" );
5960 JSONArray dataJsonArray = jsonObject .getJSONArray ("dataList" );
60- dataList = new Vector <>(dataJsonArray .length (), 2 );
61+ dataList = new Vector <>(dataJsonArray .length (), DataListCapacityIncrement );
6162 for (int i = 0 ; i < dataJsonArray .length (); i ++) {
6263 JSONObject dataJson = dataJsonArray .getJSONObject (i );
6364 UploadData data = UploadData .dataFromJson (dataJson );
0 commit comments