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

Commitf6a2a01

Browse files
author
Stephane Landelle
committed
How come getting a length could result in an IOException?
1 parentfeeeb7f commitf6a2a01

File tree

3 files changed

+6
-10
lines changed

3 files changed

+6
-10
lines changed

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,9 +217,8 @@ protected PartSource getSource() {
217217
* Return the length of the data.
218218
*
219219
* @return The length.
220-
* @throws IOException if an IO problem occurs
221220
*/
222-
protectedlonglengthOfData()throwsIOException{
221+
protectedlonglengthOfData() {
223222
returnsource.getLength();
224223
}
225224

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

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -358,9 +358,8 @@ protected int endOfHeaderLength() {
358358
* Return the length of the main content
359359
*
360360
* @return long The length.
361-
* @throws IOException If an IO problem occurs
362361
*/
363-
protectedabstractlonglengthOfData()throwsIOException;
362+
protectedabstractlonglengthOfData();
364363

365364
/**
366365
* Write the end data to the output stream.
@@ -399,7 +398,7 @@ public void send(OutputStream out) throws IOException {
399398
* @return long The length.
400399
* @throws IOException If an IO problem occurs
401400
*/
402-
publiclonglength()throwsIOException{
401+
publiclonglength() {
403402

404403
longlengthOfData =lengthOfData();
405404

@@ -501,9 +500,8 @@ public static void sendPart(OutputStream out, Part part, byte[] partBoundary) th
501500
*
502501
* @param parts The parts.
503502
* @return The total length
504-
* @throws IOException If an I/O error occurs while writing the parts.
505503
*/
506-
publicstaticlonggetLengthOfParts(Part[]parts)throwsIOException{
504+
publicstaticlonggetLengthOfParts(Part[]parts) {
507505
returngetLengthOfParts(parts,DEFAULT_BOUNDARY_BYTES);
508506
}
509507

@@ -516,7 +514,7 @@ public static long getLengthOfParts(Part[] parts) throws IOException {
516514
* @throws IOException If an I/O error occurs while writing the parts.
517515
* @since 3.0
518516
*/
519-
publicstaticlonggetLengthOfParts(Part[]parts,byte[]partBoundary)throwsIOException{
517+
publicstaticlonggetLengthOfParts(Part[]parts,byte[]partBoundary) {
520518
if (parts ==null) {
521519
thrownewIllegalArgumentException("Parts may not be null");
522520
}

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,8 @@ protected void sendData(OutputStream out) throws IOException {
110110
* Return the length of the data.
111111
*
112112
* @return The length of the data.
113-
* @throws IOException If an IO problem occurs
114113
*/
115-
protectedlonglengthOfData()throwsIOException{
114+
protectedlonglengthOfData() {
116115
returngetContent().length;
117116
}
118117

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp