Add Closeable to Transport

This commit is contained in:
Jano Svitok 2018-08-06 09:51:50 +02:00
parent 9fe4111495
commit 6a4f5c38a1
1 changed files with 2 additions and 1 deletions

View File

@ -4,7 +4,7 @@ import java.io.*;
import java.net.Socket;
import java.nio.charset.StandardCharsets;
class Transport {
class Transport implements Closeable {
private final OutputStream outputStream;
private final InputStream inputStream;
@ -64,6 +64,7 @@ class Transport {
return new SyncTransport(outputStream, inputStream);
}
@Override
public void close() throws IOException {
inputStream.close();
outputStream.close();