Refactor/Cleanup: Binary transfer

[Collection issue of multiple things I want to work on to improve the overall code quality]

H2BinaryDatabase.addBinary(UUID, InputStream) closes the provided stream even though it is not the creator (implicit transfer of responsibility)

  • don't close the stream here
  • add override addBinary(UUID, byte[]) that creates an InputStream, calls addBinary(UUID, InputStream), and closes it (via try-with-resources)
  • part of !290 (merged)

UploadCompletion internally uses a Map<...> chunks = TreeMap<>() and relies on its element order. Map does not guarantee order, so this field should not be of type Map.

ByteArrayProcessedInputStream is only used for one test implementation, but is part of the core library.

Edited by Niklas Mertsch