You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TarStreamBuilder#addEntry(String content, String fileLocation) seems to be called by ImageToTarballTranslator#toTarballBlob() to add container configuration and manifest files. Oddly the content of these files is passed as a String such that the TarStreamBuilder is responsible for performing an text to byte encoding. Rather than provide two variants of TarStreamBuilder#addEntry(), why don't we just pass the file contents as byte[] and let toTarballBlob() deal with the encoding?
The text was updated successfully, but these errors were encountered:
I think the original point of using String as a parameter type is to prevent callers from accidentally using the addEntry(String content, String fileLocation) signature for files (as opposed to addEntry(TarArchiveEntry entry)), where they accidentally read the file into a byte[] and then call this method. For files, the addEntry(TarArchiveEntry entry) signature should be used so that files are never read into memory.
From #627 (review)
TarStreamBuilder#addEntry(String content, String fileLocation)
seems to be called byImageToTarballTranslator#toTarballBlob()
to add container configuration and manifest files. Oddly the content of these files is passed as a String such that theTarStreamBuilder
is responsible for performing an text to byte encoding. Rather than provide two variants ofTarStreamBuilder#addEntry()
, why don't we just pass the file contents asbyte[]
and lettoTarballBlob()
deal with the encoding?The text was updated successfully, but these errors were encountered: