add Closeable/Flushable interfaces

This commit is contained in:
zzz
2015-08-27 14:36:19 +00:00
parent 5a11a28a35
commit 601376561b
15 changed files with 34 additions and 15 deletions

View File

@@ -13,6 +13,7 @@ import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FilenameFilter;
import java.io.Flushable;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
@@ -193,7 +194,7 @@ class PersistentDataStore extends TransientDataStore {
* we will soon have to implement a scheme for keeping only
* a subset of all DatabaseEntrys in memory and keeping the rest on disk.
*/
private class Writer implements Runnable {
private class Writer implements Runnable, Flushable {
private final Map<Hash, DatabaseEntry>_keys;
private final Object _waitLock;
private volatile boolean _quit;

View File

@@ -1,5 +1,6 @@
package net.i2p.router.transport.ntcp;
import java.io.Closeable;
import java.io.IOException;
import java.net.Inet6Address;
import java.nio.ByteBuffer;
@@ -64,7 +65,7 @@ import net.i2p.util.VersionComparator;
*</pre>
*
*/
class NTCPConnection {
class NTCPConnection implements Closeable {
private final RouterContext _context;
private final Log _log;
private SocketChannel _chan;