Skip to content

Commit bf6c768

Browse files
committed
removed Packer.flush
1 parent 573d45b commit bf6c768

File tree

6 files changed

+0
-24
lines changed

6 files changed

+0
-24
lines changed

src/main/java/org/msgpack/MessagePack.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ public void pack(OutputStream out, Object v) throws IOException {
6060
public void pack(OutputStream out, Object v, Template tmpl) throws IOException {
6161
StreamPacker pk = new StreamPacker(out);
6262
tmpl.write(pk, v);
63-
pk.flush();
6463
}
6564

6665
public byte[] pack(Value v) throws IOException { // TODO IOException

src/main/java/org/msgpack/io/Output.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,5 @@ public interface Output {
4545
public void writeByteAndFloat(byte b, float v) throws IOException;
4646

4747
public void writeByteAndDouble(byte b, double v) throws IOException;
48-
49-
public void flush() throws IOException;
5048
}
5149

src/main/java/org/msgpack/packer/AbstractMessagePackPacker.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,6 @@ protected AbstractMessagePackPacker(Output out) {
3232
this.out = out;
3333
}
3434

35-
@Override
36-
public void flush() throws IOException {
37-
out.flush();
38-
}
39-
4035
@Override
4136
public void writeByte(byte d) throws IOException {
4237
if(d < -(1<<5)) {

src/main/java/org/msgpack/packer/Packer.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,6 @@ public void write(MessagePackable v) throws IOException {
7676
v.writeTo(this);
7777
}
7878

79-
public void flush() throws IOException {
80-
}
81-
8279
/* TODO
8380
public void write(boolean v) throws IOException {
8481
writeBoolean(v);

src/test/java/org/msgpack/TestCrossLang.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,6 @@ public void testCompactSerialize() throws IOException {
7878
pk.write(av);
7979
}
8080

81-
pk.flush();
82-
8381
byte[] c = out.toByteArray();
8482

8583
assertEquals(b.length, c.length);

src/test/java/org/msgpack/TestStreamPackUnpack.java

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ public void testBoolean(boolean v) throws Exception {
1919
ByteArrayOutputStream out = new ByteArrayOutputStream();
2020
StreamPacker packer = new StreamPacker(out);
2121
packer.writeBoolean(v);
22-
packer.flush();
2322
ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
2423
StreamUnpacker unpacker = new StreamUnpacker(in);
2524
boolean ret = unpacker.readBoolean();
@@ -31,7 +30,6 @@ public void testByte(byte v) throws Exception {
3130
ByteArrayOutputStream out = new ByteArrayOutputStream();
3231
StreamPacker packer = new StreamPacker(out);
3332
packer.writeByte(v);
34-
packer.flush();
3533
ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
3634
StreamUnpacker unpacker = new StreamUnpacker(in);
3735
byte ret = unpacker.readByte();
@@ -43,7 +41,6 @@ public void testShort(short v) throws Exception {
4341
ByteArrayOutputStream out = new ByteArrayOutputStream();
4442
StreamPacker packer = new StreamPacker(out);
4543
packer.writeShort(v);
46-
packer.flush();
4744
ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
4845
StreamUnpacker unpacker = new StreamUnpacker(in);
4946
short ret = unpacker.readShort();
@@ -55,7 +52,6 @@ public void testInt(int v) throws Exception {
5552
ByteArrayOutputStream out = new ByteArrayOutputStream();
5653
StreamPacker packer = new StreamPacker(out);
5754
packer.writeInt(v);
58-
packer.flush();
5955
ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
6056
StreamUnpacker unpacker = new StreamUnpacker(in);
6157
int ret = unpacker.readInt();
@@ -67,7 +63,6 @@ public void testLong(long v) throws Exception {
6763
ByteArrayOutputStream out = new ByteArrayOutputStream();
6864
StreamPacker packer = new StreamPacker(out);
6965
packer.writeLong(v);
70-
packer.flush();
7166
ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
7267
StreamUnpacker unpacker = new StreamUnpacker(in);
7368
long ret = unpacker.readLong();
@@ -79,7 +74,6 @@ public void testFloat(float v) throws Exception {
7974
ByteArrayOutputStream out = new ByteArrayOutputStream();
8075
StreamPacker packer = new StreamPacker(out);
8176
packer.writeFloat(v);
82-
packer.flush();
8377
ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
8478
StreamUnpacker unpacker = new StreamUnpacker(in);
8579
float ret = unpacker.readFloat();
@@ -91,7 +85,6 @@ public void testDouble(double v) throws Exception {
9185
ByteArrayOutputStream out = new ByteArrayOutputStream();
9286
StreamPacker packer = new StreamPacker(out);
9387
packer.writeDouble(v);
94-
packer.flush();
9588
ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
9689
StreamUnpacker unpacker = new StreamUnpacker(in);
9790
double ret = unpacker.readDouble();
@@ -103,7 +96,6 @@ public void testNil() throws Exception {
10396
ByteArrayOutputStream out = new ByteArrayOutputStream();
10497
StreamPacker packer = new StreamPacker(out);
10598
packer.writeNil();
106-
packer.flush();
10799
ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
108100
StreamUnpacker unpacker = new StreamUnpacker(in);
109101
unpacker.readNil();
@@ -114,7 +106,6 @@ public void testBigInteger(BigInteger v) throws Exception {
114106
ByteArrayOutputStream out = new ByteArrayOutputStream();
115107
StreamPacker packer = new StreamPacker(out);
116108
packer.writeBigInteger(v);
117-
packer.flush();
118109
ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
119110
StreamUnpacker unpacker = new StreamUnpacker(in);
120111
BigInteger ret = unpacker.readBigInteger();
@@ -126,7 +117,6 @@ public void testString(String v) throws Exception {
126117
ByteArrayOutputStream out = new ByteArrayOutputStream();
127118
StreamPacker packer = new StreamPacker(out);
128119
packer.writeString(v);
129-
packer.flush();
130120
ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
131121
StreamUnpacker unpacker = new StreamUnpacker(in);
132122
String ret = unpacker.readString();
@@ -138,7 +128,6 @@ public void testByteArray(byte[] v) throws Exception {
138128
ByteArrayOutputStream out = new ByteArrayOutputStream();
139129
StreamPacker packer = new StreamPacker(out);
140130
packer.writeByteArray(v);
141-
packer.flush();
142131
ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
143132
StreamUnpacker unpacker = new StreamUnpacker(in);
144133
byte[] ret = unpacker.readByteArray();

0 commit comments

Comments
 (0)