From 7d4b573265acd7cf48d3f5fbfe9e6bb1062c8446 Mon Sep 17 00:00:00 2001 From: Max Alexander Villa Date: Wed, 29 Mar 2023 21:24:07 -0700 Subject: [PATCH] Removing oldFormat bool if not relevant to the method Some of the methods of the Utilities class using PgpLiteratalDataGenerator don't use the method for which useOldFormat is relevant. Removing oldFormat arg from method signature for those. --- PgpCore/Utilities.cs | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/PgpCore/Utilities.cs b/PgpCore/Utilities.cs index 6bde9e9..afcebdf 100644 --- a/PgpCore/Utilities.cs +++ b/PgpCore/Utilities.cs @@ -342,10 +342,9 @@ public static async Task WriteFileToLiteralDataAsync( Stream output, char fileType, FileInfo file, - byte[] buffer, - bool useOldFormat = false) + byte[] buffer) { - PgpLiteralDataGenerator lData = new PgpLiteralDataGenerator(useOldFormat); + PgpLiteralDataGenerator lData = new PgpLiteralDataGenerator(); Stream pOut = lData.Open(output, fileType, file.Name, file.LastWriteTime, buffer); await PipeFileContentsAsync(file, pOut, buffer.Length); lData.Close(); @@ -356,10 +355,9 @@ public static void WriteFileToLiteralData( Stream output, char fileType, FileInfo file, - byte[] buffer, - bool useOldFormat = false) + byte[] buffer) { - PgpLiteralDataGenerator lData = new PgpLiteralDataGenerator(useOldFormat); + PgpLiteralDataGenerator lData = new PgpLiteralDataGenerator(); Stream pOut = lData.Open(output, fileType, file.Name, file.LastWriteTime, buffer); PipeFileContents(file, pOut, buffer.Length); lData.Close(); @@ -396,10 +394,9 @@ public static async Task WriteStreamToLiteralDataAsync( char fileType, Stream input, byte[] buffer, - string name, - bool useOldFormat = false) + string name) { - PgpLiteralDataGenerator lData = new PgpLiteralDataGenerator(useOldFormat); + PgpLiteralDataGenerator lData = new PgpLiteralDataGenerator(); Stream pOut = lData.Open(output, fileType, name, DateTime.Now, buffer); await PipeStreamContentsAsync(input, pOut, buffer.Length); lData.Close(); @@ -410,10 +407,9 @@ public static void WriteStreamToLiteralData( char fileType, Stream input, byte[] buffer, - string name, - bool useOldFormat = false) + string name) { - PgpLiteralDataGenerator lData = new PgpLiteralDataGenerator(useOldFormat); + PgpLiteralDataGenerator lData = new PgpLiteralDataGenerator(); Stream pOut = lData.Open(output, fileType, name, DateTime.Now, buffer); PipeStreamContents(input, pOut, buffer.Length); lData.Close();