Croway commented on PR #27132: URL: https://github.com/apache/camel/pull/27132#issuecomment-5915916292
@davsclaus thanks for the careful review. Both data issues were real, and I reproduced them with the exact numbers you gave. They are fixed in 5c6cb2a22375; details are in the inline replies. - **`StreamCache` character length:** only byte-stream caches are trusted now. Regression test: `AWS2S3ProducerPayloadLengthTest#uploadReaderCacheBodyWithNonAsciiText`. - **UTF-16 BOM per chunk:** `ReaderInputStream` now uses one `CharsetEncoder` for the whole stream and flushes it at the end. Regression test: `GenericFileHelperTest#shouldEncodeStreamBodyWithCharsetThatWritesByteOrderMark`. - **`ByteBuffer`:** the case is removed, so the length comes from the converted stream. - **Public helpers:** `AWS2S3Utils.determineLengthInputStream`, `BlobUtils.getInputStreamLength` and `DataLakeUtils.getInputStreamLength` are now `@Deprecated(since = "4.23.0")` in favour of `PayloadHelper.getLength`. - **`charset` option description:** I left it unchanged. It says Camel *may* read the message into memory, which is still true for `String` bodies. Rewording it would regenerate the shared `GenericFileEndpoint` metadata across file, ftp, ftps, sftp and smb, the catalog and the endpoint DSL. The new Large payloads page describes the streaming behaviour. Happy to do it in a follow-up if you prefer. Re-run locally after the fixes, all green: | Module | Tests | |---|---| | camel-util | 288 | | camel-core (charset, file, stream caching, XML converter, splitter subsets) | 433 | | camel-file | 24 | | aws2-s3 | 79 | | azure-storage-blob | 58 | | azure-storage-datalake | 16 | | google-storage | 30 | | ibm-cos | 2 | | minio | 3 | | ftp/sftp producer and charset ITs | 83 | | smb charset IT (Docker) | 1 | _Claude Code on behalf of Federico Mariani (Croway)_ -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
