[
https://issues.apache.org/jira/browse/PDFBOX-5451?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17553914#comment-17553914
]
Andreas Lehmkühler commented on PDFBOX-5451:
--------------------------------------------
IMHO it isn't that easy as it looks like. The setter is used when
encrypting/decrypting a string and the existing COSObject is modified in that
context. If we eliminate the setter we have to deal with new objects instead of
using the exisiting one and that would require to refactor the code in
question. To me it looks like something which isn't that easy to achieve. But
maybe I'm overlooking something and am open to any solution.
> Avoid copying byte array for COSString
> --------------------------------------
>
> Key: PDFBOX-5451
> URL: https://issues.apache.org/jira/browse/PDFBOX-5451
> Project: PDFBox
> Issue Type: Improvement
> Components: Parsing
> Affects Versions: 3.0.0 PDFBox
> Reporter: Andreas Lehmkühler
> Assignee: Andreas Lehmkühler
> Priority: Major
> Fix For: 3.0.0 PDFBox
>
>
> When creating a COSString the given byte array is cloned. As in most cases
> the array is just an intermediate object we should remove that to reduce the
> memory footprint.
> Furthermore the {{getBytes}} returns the internal byte array so that I don't
> see any reason not to use the given byte array itself instead of cloning it
--
This message was sent by Atlassian Jira
(v8.20.7#820007)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]