File tree Expand file tree Collapse file tree 1 file changed +25
-27
lines changed
cf-java-logging-support-servlet/src/main/java/com/sap/hcp/cf/logging/servlet/filter Expand file tree Collapse file tree 1 file changed +25
-27
lines changed Original file line number Diff line number Diff line change 77
88public class WrappedOutputStream extends ServletOutputStream {
99
10- private long contentLength = -1 ;
11- private final ServletOutputStream wrappedStream ;
12-
13- public WrappedOutputStream (ServletOutputStream out ) {
14- wrappedStream = out ;
15- }
16-
17- public long getContentLength () {
18- return contentLength ;
19- }
20-
21- @ Override
22- public void write (int b ) throws IOException {
23- wrappedStream .write (b );
24- incrContentLength (1 );
25- }
26-
27- private void incrContentLength (int i ) {
28- if (contentLength == -1 ) {
29- contentLength = i ;
30- } else {
31- contentLength += i ;
32- }
33- }
10+ private long contentLength = -1 ;
11+ private final OutputStream wrappedStream ;
12+
13+ public WrappedOutputStream (OutputStream out ) {
14+ wrappedStream = out ;
15+ }
16+
17+ public long getContentLength () {
18+ return contentLength ;
19+ }
20+
21+ @ Override
22+ public void write (int b ) throws IOException {
23+ wrappedStream .write (b );
24+ incrContentLength (1 );
25+ }
26+
27+ private void incrContentLength (int i ) {
28+ if (contentLength == -1 ) {
29+ contentLength = i ;
30+ } else {
31+ contentLength += i ;
32+ }
33+ }
3434
3535 @ Override
3636 public void write (byte [] b ) throws IOException {
@@ -51,8 +51,6 @@ public void close() throws IOException {
5151
5252 @ Override
5353 public void flush () throws IOException {
54- try (OutputStream ostream = wrappedStream ) {
55- wrappedStream .flush ();
56- }
54+ wrappedStream .flush ();
5755 }
5856}
You can’t perform that action at this time.
0 commit comments