Skip to content

Commit

Permalink
Override putBytes() method in DbResourceReference, the default Resour…
Browse files Browse the repository at this point in the history
…ceReference.putBytes() method behaves poorly because it wraps it in a stream and in DbResourceReference a stream is read into memory, creating a duplicate byte[], much better to go direct and avoid a duplicate buffer
  • Loading branch information
jonesde committed Nov 10, 2022
1 parent c97fc56 commit f41446d
Showing 1 changed file with 3 additions and 0 deletions.
Expand Up @@ -140,6 +140,9 @@ class DbResourceReference extends BaseResourceReference {
SerialBlob sblob = new SerialBlob(baos.toByteArray())
this.putObject(sblob)
}
@Override void putBytes(byte[] bytes) {
this.putObject(new SerialBlob(bytes))
}

protected void putObject(Object fileObj) {
EntityValue dbrf = getDbResourceFile()
Expand Down

0 comments on commit f41446d

Please sign in to comment.