Note that there are some explanatory texts on larger screens.

plurals
  1. POFile.length() different than windows, file contents still equal?
    primarykey
    data
    text
    <h2>Read the update at the bottom</h2> <p>I've been scratching my head over this for a few hours and cannot seem to figure this out.</p> <p>For a unit test, we copy a file to a temporary location and run soms scenario's on it. This file copy does VERY weird things. This only happens with PDF files, images were not affected. I've tried a few different ways of copying/gathering file sizes and all do the same thing.</p> <ul> <li>The file.length() is not consistent with what windows lists. java thinks the file is larger (roughly 25% more bytes)</li> <li>When the file/bytes are read/copied/etc they end up with the number of bytes JAVA reports. (too many)</li> <li>Intellij reports both input and output files as identical. (possible due to intellij using java for its diffs)</li> <li>when i open both files notepad++, there are a few differences. All text based information (it is a pdf) is identical. data wrapped in 'stream' tags is different!</li> </ul> <p>the original: </p> <p>xÚ¥‘=OÃ@†÷ü</p> <p>the new file:</p> <p>xڥ�=O�@���</p> <p>This leads me to suspect an encoding issue or something alike...</p> <p>But...</p> <ul> <li>Why does this happen on a byte per byte copy?</li> <li>Why does this happen when using a simple file.length()?</li> </ul> <p>Has anyone come across something like this or knows in which direction i should search?</p> <p>Upon request: This is the code used to copy the files:</p> <p><code>assetFile = TempFileUtil.createTempFile(transformationId + "_" + inputFile.getName()); FileUtils.copyFile(inputFile, assetFile);</code></p> <p>and the createTempFile method is:</p> <p><code>public static File createTempFile(final String filename) { return new File(baseOutputPath, filename); }</code></p> <h1>update</h1> <p>I've discoverd that the fault was not with the copying but with the way resources are handled in unit tests. The /src/resources/ folder contents are moved/linked/copied to targer/test-classes/ folder so it is accessible in unit tests etc... and that is where is goes wrong... I'm still trying to find out why this is failing.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload