Patch: Open TemporaryBuffer in try-with-resource

Change-Id: I90bff8d49ecc37b8c10ce909cd3ac563205b641c
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
This commit is contained in:
David Pursehouse 2018-02-27 14:12:10 +09:00 committed by Matthias Sohn
parent a573dfc658
commit 86330ca2ad
1 changed files with 4 additions and 4 deletions

View File

@ -152,10 +152,10 @@ public void parse(final InputStream is) throws IOException {
}
private static byte[] readFully(final InputStream is) throws IOException {
TemporaryBuffer b = new TemporaryBuffer.Heap(Integer.MAX_VALUE);
b.copy(is);
b.close();
return b.toByteArray();
try (TemporaryBuffer b = new TemporaryBuffer.Heap(Integer.MAX_VALUE)) {
b.copy(is);
return b.toByteArray();
}
}
/**