Properly close/flush TransportOutputStream.

Resolves #1206,#1207.
This commit is contained in:
Leandro Quiroga
2021-07-31 20:06:41 -03:00
committed by Greg L. Turnquist
parent ec8800138f
commit aefa4e4de6
2 changed files with 9 additions and 3 deletions

View File

@@ -47,7 +47,9 @@ public abstract class TransportInputStream extends InputStream {
@Override
public void close() throws IOException {
getInputStream().close();
if (inputStream != null) {
getInputStream().close();
}
}
@Override

View File

@@ -45,12 +45,16 @@ public abstract class TransportOutputStream extends OutputStream {
@Override
public void close() throws IOException {
getOutputStream().close();
if (outputStream != null) {
getOutputStream().close();
}
}
@Override
public void flush() throws IOException {
getOutputStream().flush();
if (outputStream != null) {
getOutputStream().flush();
}
}
@Override