decompressLogBatch method

Future<List<CompressibleLogEntry>> decompressLogBatch(
  1. CompressedLogBatch batch
)

Decompresses a compressed log batch

Implementation

Future<List<CompressibleLogEntry>> decompressLogBatch(
  CompressedLogBatch batch,
) async {
  try {
    final decompressedBytes = await _decompressBytes(batch.compressedData);
    final jsonString = utf8.decode(decompressedBytes);
    final jsonData = jsonDecode(jsonString) as List;

    return jsonData
        .map(
          (data) =>
              CompressibleLogEntry.fromJson(data as Map<String, dynamic>),
        )
        .toList();
  } catch (e) {
    throw Exception('Failed to decompress log batch: $e');
  }
}