From 148c790410e14d94419108cc9ac849093e317888 Mon Sep 17 00:00:00 2001 From: Armin Date: Wed, 23 Oct 2024 14:31:23 +0100 Subject: [PATCH] [LEIP-287] Remove CYF header --- .../persistence/serialization/TransferFileSerializer.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/persistence/src/main/kotlin/de/cyface/persistence/serialization/TransferFileSerializer.kt b/persistence/src/main/kotlin/de/cyface/persistence/serialization/TransferFileSerializer.kt index 23e3611a..39e3c125 100644 --- a/persistence/src/main/kotlin/de/cyface/persistence/serialization/TransferFileSerializer.kt +++ b/persistence/src/main/kotlin/de/cyface/persistence/serialization/TransferFileSerializer.kt @@ -310,13 +310,13 @@ object TransferFileSerializer { // Currently loading one image per transfer file into memory (~ 2-5 MB / image). // - To load add all high-res image data or video data in the future we cannot use the pre-compiled // builder but have to stream the data without loading it into memory to avoid an OOM exception. - val transferFileHeader = DataSerializable.transferFileHeader() + //val transferFileHeader = DataSerializable.transferFileHeader() //val uploadBytes = builder.build().toByteArray() val uploadBytes = attachment.bytes.toByteArray() try { // The stream must be closed by the caller in a finally catch withContext(Dispatchers.IO) { - bufferedOutputStream.write(transferFileHeader) + //bufferedOutputStream.write(transferFileHeader) bufferedOutputStream.write(uploadBytes) bufferedOutputStream.flush() } @@ -329,7 +329,7 @@ object TransferFileSerializer { Locale.getDefault(), "Serialized attachment: %s", DataSerializable.humanReadableSize( - (transferFileHeader.size + uploadBytes.size).toLong(), + (/*transferFileHeader.size +*/ uploadBytes.size).toLong(), true ) )