Patch: Open TemporaryBuffer in try-with-resource
Change-Id: I90bff8d49ecc37b8c10ce909cd3ac563205b641c Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
This commit is contained in:
parent
a573dfc658
commit
86330ca2ad
|
@ -152,10 +152,10 @@ public void parse(final InputStream is) throws IOException {
|
||||||
}
|
}
|
||||||
|
|
||||||
private static byte[] readFully(final InputStream is) throws IOException {
|
private static byte[] readFully(final InputStream is) throws IOException {
|
||||||
TemporaryBuffer b = new TemporaryBuffer.Heap(Integer.MAX_VALUE);
|
try (TemporaryBuffer b = new TemporaryBuffer.Heap(Integer.MAX_VALUE)) {
|
||||||
b.copy(is);
|
b.copy(is);
|
||||||
b.close();
|
return b.toByteArray();
|
||||||
return b.toByteArray();
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue