@@ -231,8 +231,8 @@ protected void sendDispositionHeader(OutputStream out) throws IOException {
231
231
}
232
232
}
233
233
234
- protected int dispositionHeaderLength () {
235
- int length = 0 ;
234
+ protected long dispositionHeaderLength () {
235
+ long length = 0L ;
236
236
if (getName () != null ) {
237
237
length += CRLF_BYTES .length ;
238
238
length += CONTENT_DISPOSITION_BYTES .length ;
@@ -263,8 +263,8 @@ protected void sendContentTypeHeader(OutputStream out) throws IOException {
263
263
}
264
264
}
265
265
266
- protected int contentTypeHeaderLength () {
267
- int length = 0 ;
266
+ protected long contentTypeHeaderLength () {
267
+ long length = 0L ;
268
268
String contentType = getContentType ();
269
269
if (contentType != null ) {
270
270
length += CRLF_BYTES .length ;
@@ -294,8 +294,8 @@ protected void sendTransferEncodingHeader(OutputStream out) throws IOException {
294
294
}
295
295
}
296
296
297
- protected int transferEncodingHeaderLength () {
298
- int length = 0 ;
297
+ protected long transferEncodingHeaderLength () {
298
+ long length = 0L ;
299
299
String transferEncoding = getTransferEncoding ();
300
300
if (transferEncoding != null ) {
301
301
length += CRLF_BYTES .length ;
@@ -320,8 +320,8 @@ protected void sendContentIdHeader(OutputStream out) throws IOException {
320
320
}
321
321
}
322
322
323
- protected int contentIdHeaderLength () {
324
- int length = 0 ;
323
+ protected long contentIdHeaderLength () {
324
+ long length = 0L ;
325
325
String contentId = getContentId ();
326
326
if (contentId != null ) {
327
327
length += CRLF_BYTES .length ;
@@ -342,7 +342,7 @@ protected void sendEndOfHeader(OutputStream out) throws IOException {
342
342
out .write (CRLF_BYTES );
343
343
}
344
344
345
- protected int endOfHeaderLength () {
345
+ protected long endOfHeaderLength () {
346
346
return CRLF_BYTES .length * 2 ;
347
347
}
348
348
@@ -371,7 +371,7 @@ protected void sendEnd(OutputStream out) throws IOException {
371
371
out .write (CRLF_BYTES );
372
372
}
373
373
374
- protected int endLength () {
374
+ protected long endLength () {
375
375
return CRLF_BYTES .length ;
376
376
}
377
377
@@ -402,8 +402,8 @@ public long length() {
402
402
403
403
long lengthOfData = lengthOfData ();
404
404
405
- if (lengthOfData < 0 ) {
406
- return -1 ;
405
+ if (lengthOfData < 0L ) {
406
+ return -1L ;
407
407
} else {
408
408
return lengthOfData //
409
409
+ startLength ()//
0 commit comments