Removed Writer.close().

This commit is contained in:
akwizgran
2011-07-22 18:08:05 +01:00
parent fe58fb4c30
commit 5d000b62f8
7 changed files with 3 additions and 17 deletions

View File

@@ -84,7 +84,8 @@ class BundleWriterImpl implements BundleWriter {
}
if(state != State.MORE_BATCHES) throw new IllegalStateException();
writer.writeListEnd();
writer.close();
out.flush();
out.close();
state = State.END;
}
}

View File

@@ -52,7 +52,6 @@ class MessageEncoderImpl implements MessageEncoder {
// Write the signature
w.writeRaw(sig);
byte[] raw = out.toByteArray();
w.close();
// The message ID is the hash of the entire message
messageDigest.reset();
messageDigest.update(raw);
@@ -62,7 +61,6 @@ class MessageEncoderImpl implements MessageEncoder {
w = writerFactory.createWriter(out);
w.writeString(nick);
w.writeRaw(keyPair.getPublic().getEncoded());
w.close();
messageDigest.reset();
messageDigest.update(out.toByteArray());
AuthorId authorId = new AuthorId(messageDigest.digest());

View File

@@ -25,11 +25,6 @@ class WriterImpl implements Writer {
return bytesWritten;
}
public void close() throws IOException {
out.flush();
out.close();
}
public void writeBoolean(boolean b) throws IOException {
if(b) out.write(Tag.TRUE);
else out.write(Tag.FALSE);