Skip to content

Commit 7f6d27f

Browse files
committed
Update BufferedOutStream.java
1 parent 92f9d07 commit 7f6d27f

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

avaje-jex/src/main/java/io/avaje/jex/core/BufferedOutStream.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
import java.io.FilterOutputStream;
55
import java.io.IOException;
66

7-
import com.sun.net.httpserver.HttpExchange;
8-
97
final class BufferedOutStream extends FilterOutputStream {
108

119
private final long max;
@@ -58,12 +56,11 @@ public void write(byte[] b, int off, int len) throws IOException {
5856

5957
/** Use the underlying OutputStream. Chunking the response if needed */
6058
private void useJdkOutput() throws IOException {
61-
final HttpExchange exchange = context.exchange();
59+
final var exchange = context.exchange();
6260
// if a manual content-length is set, honor that instead of chunking
63-
String length = context.responseHeader(Constants.CONTENT_LENGTH);
61+
var length = context.responseHeader(Constants.CONTENT_LENGTH);
6462
exchange.sendResponseHeaders(context.statusCode(), length == null ? 0 : Long.parseLong(length));
6563
jdkOutput = true;
66-
6764
// empty the existing buffer
6865
if (buffer != null) {
6966
buffer.writeTo(out);

0 commit comments

Comments
 (0)