LPS-16196 Add a FileInputStream that deletes the file on close
LPS-16196 Convert toByteArray into toInputStream, and reimplement toByteArray to reuse the input stream
LPS-16196 Re-add methods