Skip to content

Commit a87300c

Browse files
committed
in many cases, the buffer is not needed
1 parent db048b0 commit a87300c

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

src/main/java/com/github/diegonighty/http/request/types/WrappedHttpPostRequest.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
import com.github.diegonighty.http.serialization.RequestSerializer;
77
import com.github.diegonighty.http.util.StatusCode;
88

9-
import java.io.BufferedOutputStream;
109
import java.io.IOException;
1110
import java.net.HttpURLConnection;
1211

@@ -49,9 +48,7 @@ public HttpResponse<Integer> execute() throws FailedConnectionException, IOExcep
4948

5049
connection.connect();
5150

52-
try (BufferedOutputStream stream = new BufferedOutputStream(connection.getOutputStream())) {
53-
serializer.serialize(object, stream);
54-
}
51+
serializer.serialize(object, connection.getOutputStream());
5552

5653
if (!StatusCode.isSuccessful(connection.getResponseCode())) {
5754
throw new FailedConnectionException("Server is not responding", connection.getResponseCode());

0 commit comments

Comments
 (0)