Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closing/Flushing DataOutputStream before calling toByteArray on the underlying ByteArrayOutputStream #4

Merged
merged 1 commit into from
Jan 12, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ public void writeTo(OutputStream os) throws IOException {
dos.writeBoolean(fastFp);
dos.write(polyType.ordinal());
dos.writeUTF(hashAlg);
dos.flush();
}


Expand Down
1 change: 1 addition & 0 deletions src/main/java/net/sf/ntru/sign/SignatureParameters.java
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ public void writeTo(OutputStream os) throws IOException {
dos.write(keyGenAlg.ordinal());
dos.writeUTF(hashAlg);
dos.write(polyType.ordinal());
dos.flush();
}

@Override
Expand Down
1 change: 1 addition & 0 deletions src/main/java/net/sf/ntru/sign/SignaturePrivateKey.java
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ public byte[] getEncoded() {
for (int i=0; i<numBases; i++)
// all bases except for the first one contain a public key
bases.get(i).encode(os, i!=0);
dataStream.close();
} catch (IOException e) {
throw new NtruException(e);
}
Expand Down
1 change: 1 addition & 0 deletions src/main/java/net/sf/ntru/sign/SignaturePublicKey.java
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ public byte[] getEncoded() {
dataStream.writeShort(h.coeffs.length);
dataStream.writeShort(q);
dataStream.write(h.toBinary(q));
dataStream.close();
} catch (IOException e) {
throw new NtruException(e);
}
Expand Down