Skip to content

Commit

Permalink
OAK-11377: Remove usage of Guava ByteStreams.toByteArray() - avoid de…
Browse files Browse the repository at this point in the history
…precated method
  • Loading branch information
reschke committed Jan 10, 2025
1 parent a04a20a commit d210344
Showing 1 changed file with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -156,13 +156,10 @@ protected byte[] readBlockFromBackend(BlockId blockId) throws Exception {
LOG.error(message);
throw new IOException(message);
}

Payload payload = cloudBlob.getPayload();
try {
data = payload.getInput().readAllBytes();
cache.put(id, data);
} finally {
payload.close();

try (Payload payload = cloudBlob.getPayload()) {
data = payload.openStream().readAllBytes();
cache.put(id, data);
}
}
if (blockId.getPos() == 0) {
Expand Down

0 comments on commit d210344

Please sign in to comment.