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

@@ -1,5 +1,6 @@
package net.i2p.client.streaming.impl;
import java.io.Closeable;
import java.io.IOException;
import java.util.Iterator;
import java.util.Map;
@@ -25,7 +26,7 @@ import net.i2p.util.SimpleTimer2;
*<p>
* MessageOutputStream -> ConnectionDataReceiver -> Connection -> PacketQueue -> I2PSession
*/
class PacketQueue implements SendMessageStatusListener {
class PacketQueue implements SendMessageStatusListener, Closeable {
private final I2PAppContext _context;
private final Log _log;
private final ByteCache _cache = ByteCache.getInstance(64, 36*1024);

View File

@@ -1,8 +1,10 @@
package net.i2p.client.streaming.impl;
import java.io.BufferedOutputStream;
import java.io.Closeable;
import java.io.File;
import java.io.FileOutputStream;
import java.io.Flushable;
import java.io.IOException;
import java.io.OutputStream;
@@ -41,7 +43,7 @@ import net.i2p.data.DataHelper;
*
* @since 0.9.4
*/
public class PcapWriter {
public class PcapWriter implements Closeable, Flushable {
/** big-endian, see file format ref - 24 bytes */
private static final byte[] FILE_HEADER = { (byte) 0xa1, (byte) 0xb2, (byte) 0xc3, (byte) 0xd4,