Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit3a2a6d6

Browse files
author
Stephane Landelle
committed
Part length is long, not int
1 parent44480ab commit3a2a6d6

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

‎src/main/java/com/ning/http/multipart/FilePart.java‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,9 +156,9 @@ protected void sendDispositionHeader(OutputStream out) throws IOException {
156156
}
157157
}
158158

159-
protectedintdispositionHeaderLength() {
159+
protectedlongdispositionHeaderLength() {
160160
Stringfilename =this.source.getFileName();
161-
intlength =super.dispositionHeaderLength();
161+
longlength =super.dispositionHeaderLength();
162162
if (filename !=null) {
163163
length +=FILE_NAME_BYTES.length;
164164
length +=QUOTE_BYTES.length;

‎src/main/java/com/ning/http/multipart/MultipartRequestEntity.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ public long getContentLength() {
134134
returnPart.getLengthOfParts(parts,multipartBoundary);
135135
}catch (Exceptione) {
136136
log.error("An exception occurred while getting the length of the parts",e);
137-
return0;
137+
return0L;
138138
}
139139
}
140140

‎src/main/java/com/ning/http/multipart/Part.java‎

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -231,8 +231,8 @@ protected void sendDispositionHeader(OutputStream out) throws IOException {
231231
}
232232
}
233233

234-
protectedintdispositionHeaderLength() {
235-
intlength =0;
234+
protectedlongdispositionHeaderLength() {
235+
longlength =0L;
236236
if (getName() !=null) {
237237
length +=CRLF_BYTES.length;
238238
length +=CONTENT_DISPOSITION_BYTES.length;
@@ -263,8 +263,8 @@ protected void sendContentTypeHeader(OutputStream out) throws IOException {
263263
}
264264
}
265265

266-
protectedintcontentTypeHeaderLength() {
267-
intlength =0;
266+
protectedlongcontentTypeHeaderLength() {
267+
longlength =0L;
268268
StringcontentType =getContentType();
269269
if (contentType !=null) {
270270
length +=CRLF_BYTES.length;
@@ -294,8 +294,8 @@ protected void sendTransferEncodingHeader(OutputStream out) throws IOException {
294294
}
295295
}
296296

297-
protectedinttransferEncodingHeaderLength() {
298-
intlength =0;
297+
protectedlongtransferEncodingHeaderLength() {
298+
longlength =0L;
299299
StringtransferEncoding =getTransferEncoding();
300300
if (transferEncoding !=null) {
301301
length +=CRLF_BYTES.length;
@@ -320,8 +320,8 @@ protected void sendContentIdHeader(OutputStream out) throws IOException {
320320
}
321321
}
322322

323-
protectedintcontentIdHeaderLength() {
324-
intlength =0;
323+
protectedlongcontentIdHeaderLength() {
324+
longlength =0L;
325325
StringcontentId =getContentId();
326326
if (contentId !=null) {
327327
length +=CRLF_BYTES.length;
@@ -342,7 +342,7 @@ protected void sendEndOfHeader(OutputStream out) throws IOException {
342342
out.write(CRLF_BYTES);
343343
}
344344

345-
protectedintendOfHeaderLength() {
345+
protectedlongendOfHeaderLength() {
346346
returnCRLF_BYTES.length *2;
347347
}
348348

@@ -371,7 +371,7 @@ protected void sendEnd(OutputStream out) throws IOException {
371371
out.write(CRLF_BYTES);
372372
}
373373

374-
protectedintendLength() {
374+
protectedlongendLength() {
375375
returnCRLF_BYTES.length;
376376
}
377377

@@ -402,8 +402,8 @@ public long length() {
402402

403403
longlengthOfData =lengthOfData();
404404

405-
if (lengthOfData <0) {
406-
return -1;
405+
if (lengthOfData <0L) {
406+
return -1L;
407407
}else {
408408
returnlengthOfData//
409409
+startLength()//

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp