From 994d3005ed8e576928eb83851885e49b7394353a Mon Sep 17 00:00:00 2001
From: Russell Shaw <69813534+kiwi1969@users.noreply.github.com>
Date: Tue, 26 Mar 2024 17:25:52 -0400
Subject: [PATCH 01/29] Update README.md
Signed-off-by: Russell Shaw <69813534+kiwi1969@users.noreply.github.com>
---
README.md | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 2d41f3c..0cd4ba1 100644
--- a/README.md
+++ b/README.md
@@ -15,6 +15,11 @@ IBM Mainframe files on any workstation or laptop etc. that supports Java.
## Updates ##
+**Version 5.0.1: March 2024**
+
+- Added support to decompress then recompress into a gzip file if output-file name ends in ".gz"
+- Updated pom.xml to have Maven compile using Java 17, and shade the jar.
+
**Version 5: March 2021**
- Support for variable length binary records. Variable length records processed in binary mode will be prefixed with a 4 byte field in the same format as the IBM RDW i.e. 2 byte record length field (including RDW length, big-endian) followed by 2 bytes of zeros.
@@ -25,7 +30,7 @@ For execution, TerseDecompress needs a JVM runtime environment.
Usage:
-```java -jar tersedecompress-5.0.0.jar [-b] tersed-file output-file```
+```java -jar tersedecompress-5.0.1.jar [-b] tersed-file output-file```
Default mode is text mode, which will attempt EBCDIC -> ASCII conversion.
From 4b22ad368fbc72b8a03522d589878af8cbbd13c9 Mon Sep 17 00:00:00 2001
From: Russell Shaw <69813534+kiwi1969@users.noreply.github.com>
Date: Tue, 26 Mar 2024 17:28:46 -0400
Subject: [PATCH 02/29] Update pom.xml
Signed-off-by: Russell Shaw <69813534+kiwi1969@users.noreply.github.com>
---
pom.xml | 57 ++++++++++++++++++++++++++++++++++++++++++---------------
1 file changed, 42 insertions(+), 15 deletions(-)
diff --git a/pom.xml b/pom.xml
index af9b839..5f279ff 100644
--- a/pom.xml
+++ b/pom.xml
@@ -5,7 +5,7 @@
org.openmainframeproject.tersedecompress
tersedecompress
- 5.0.0
+ 5.0.1
jar
tersedecompress
@@ -13,6 +13,10 @@
UTF-8
+ 17
+ 4.13.1
+ 3.12.1
+ 3.5.1
true
@@ -20,24 +24,47 @@
org.apache.maven.plugins
maven-compiler-plugin
- 3.8.1
+ ${maven-compiler-version}
-
- 1.8
+ ${jdk-release}
org.apache.maven.plugins
- maven-jar-plugin
- 3.2.0
-
-
-
- true
- org.openmainframeproject.tersedecompress.TerseDecompress
-
-
-
+ maven-shade-plugin
+ ${maven-shade-version}
+
+
+ package
+
+ shade
+
+
+
+
+ *:*
+
+ META-INF/*.SF
+ META-INF/*.DSA
+ META-INF/*.RSA
+
+
+
+ true
+
+ org.openmainframeproject.tersedecompress.TerseDecompress
+
+
+
+
+ org.openmainframeproject.tersedecompress.TerseDecompress
+
+
+
+
+
+
@@ -45,7 +72,7 @@
junit
junit
- 4.13.1
+ ${junit-version}
test
From 5708147e1302b7ed6294828733789453b9c6f79d Mon Sep 17 00:00:00 2001
From: Russell Shaw <69813534+kiwi1969@users.noreply.github.com>
Date: Tue, 26 Mar 2024 17:33:10 -0400
Subject: [PATCH 03/29] Handle gzip output files
Signed-off-by: Russell Shaw <69813534+kiwi1969@users.noreply.github.com>
---
.../tersedecompress/TerseDecompress.java | 23 ++++++++++++-------
1 file changed, 15 insertions(+), 8 deletions(-)
diff --git a/src/main/java/org/openmainframeproject/tersedecompress/TerseDecompress.java b/src/main/java/org/openmainframeproject/tersedecompress/TerseDecompress.java
index 497e28c..cf82829 100644
--- a/src/main/java/org/openmainframeproject/tersedecompress/TerseDecompress.java
+++ b/src/main/java/org/openmainframeproject/tersedecompress/TerseDecompress.java
@@ -34,8 +34,12 @@
/* Andrew Rowley, Black Hill Software */
/* Mario Bezzi, Watson Walker */
/*****************************************************************************/
+/* Version 6: support for gzipped output records */
+/* Russell Shaw */
+/*****************************************************************************/
import java.io.*;
+import java.util.zip.GZIPOutputStream;
class TerseDecompress {
@@ -46,7 +50,7 @@ class TerseDecompress {
+"The -b flag turns on binary mode, no conversion will be attempted\n"
);
- private static final String Version = new String ("Version 5, March 2021");
+ private static final String Version = new String ("Version 6, March 2024");
private void printUsageAndExit() {
System.out.println(DetailedHelp);
@@ -95,14 +99,17 @@ else if (outputFileName == null)
printUsageAndExit();
}
+ TerseDecompresser outputWriter = null;
+ FileOutputStream fileOutputStream = new FileOutputStream(outputFileName);
+
+ if (outputFileName.endsWith(".gz"))
+ outputWriter = TerseDecompresser.create(new FileInputStream(inputFileName), new GZIPOutputStream(fileOutputStream));
+ else
+ outputWriter = TerseDecompresser.create(new FileInputStream(inputFileName), fileOutputStream);
- try (TerseDecompresser outputWriter
- = TerseDecompresser.create(new FileInputStream(inputFileName), new FileOutputStream(outputFileName)))
- {
- outputWriter.TextFlag = textMode;
- System.out.println("Attempting to decompress input file (" + inputFileName +") to output file (" + outputFileName +")");
- outputWriter.decode();
- }
+ outputWriter.TextFlag = textMode;
+ System.out.println("Attempting to decompress input file (" + inputFileName +") to output file (" + outputFileName +")");
+ outputWriter.decode();
System.out.println("Processing completed");
}
From abcb9c686481ef5318a1c3322ef55cd73b35d314 Mon Sep 17 00:00:00 2001
From: Russell Shaw <69813534+kiwi1969@users.noreply.github.com>
Date: Tue, 26 Mar 2024 17:33:52 -0400
Subject: [PATCH 04/29] Handle gzip output files
Signed-off-by: Russell Shaw <69813534+kiwi1969@users.noreply.github.com>
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 0cd4ba1..6daf824 100644
--- a/README.md
+++ b/README.md
@@ -15,7 +15,7 @@ IBM Mainframe files on any workstation or laptop etc. that supports Java.
## Updates ##
-**Version 5.0.1: March 2024**
+**Version 6: March 2024**
- Added support to decompress then recompress into a gzip file if output-file name ends in ".gz"
- Updated pom.xml to have Maven compile using Java 17, and shade the jar.
From 23cdcdc33113ab3f8a1686090217f915a1f153f9 Mon Sep 17 00:00:00 2001
From: Russell Shaw <69813534+kiwi1969@users.noreply.github.com>
Date: Tue, 26 Mar 2024 17:34:44 -0400
Subject: [PATCH 05/29] Handle gzip output files
Signed-off-by: Russell Shaw <69813534+kiwi1969@users.noreply.github.com>
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 6daf824..580c845 100644
--- a/README.md
+++ b/README.md
@@ -30,7 +30,7 @@ For execution, TerseDecompress needs a JVM runtime environment.
Usage:
-```java -jar tersedecompress-5.0.1.jar [-b] tersed-file output-file```
+```java -jar tersedecompress-6.0.0.jar [-b] tersed-file output-file```
Default mode is text mode, which will attempt EBCDIC -> ASCII conversion.
From 9ab9bc5f37202a355fec05fab15687c5cecefb60 Mon Sep 17 00:00:00 2001
From: Russell Shaw <69813534+kiwi1969@users.noreply.github.com>
Date: Tue, 26 Mar 2024 17:36:23 -0400
Subject: [PATCH 06/29] Handle gzip output files
Signed-off-by: Russell Shaw <69813534+kiwi1969@users.noreply.github.com>
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index 5f279ff..bf29766 100644
--- a/pom.xml
+++ b/pom.xml
@@ -5,7 +5,7 @@
org.openmainframeproject.tersedecompress
tersedecompress
- 5.0.1
+ 6.0.0
jar
tersedecompress
From 2ebc0ce4d6156d836c29661b57a918cfd0b52367 Mon Sep 17 00:00:00 2001
From: Russell Shaw <69813534+kiwi1969@users.noreply.github.com>
Date: Wed, 27 Mar 2024 11:18:33 -0400
Subject: [PATCH 07/29] Update README.md
Signed-off-by: Russell Shaw <69813534+kiwi1969@users.noreply.github.com>
---
README.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/README.md b/README.md
index 580c845..0cd4ba1 100644
--- a/README.md
+++ b/README.md
@@ -15,7 +15,7 @@ IBM Mainframe files on any workstation or laptop etc. that supports Java.
## Updates ##
-**Version 6: March 2024**
+**Version 5.0.1: March 2024**
- Added support to decompress then recompress into a gzip file if output-file name ends in ".gz"
- Updated pom.xml to have Maven compile using Java 17, and shade the jar.
@@ -30,7 +30,7 @@ For execution, TerseDecompress needs a JVM runtime environment.
Usage:
-```java -jar tersedecompress-6.0.0.jar [-b] tersed-file output-file```
+```java -jar tersedecompress-5.0.1.jar [-b] tersed-file output-file```
Default mode is text mode, which will attempt EBCDIC -> ASCII conversion.
From fc0333ce556750ec6bc2423dbf586b138bd84772 Mon Sep 17 00:00:00 2001
From: Russell Shaw <69813534+kiwi1969@users.noreply.github.com>
Date: Wed, 27 Mar 2024 11:19:08 -0400
Subject: [PATCH 08/29] Update pom.xml
Signed-off-by: Russell Shaw <69813534+kiwi1969@users.noreply.github.com>
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index bf29766..5f279ff 100644
--- a/pom.xml
+++ b/pom.xml
@@ -5,7 +5,7 @@
org.openmainframeproject.tersedecompress
tersedecompress
- 6.0.0
+ 5.0.1
jar
tersedecompress
From 01a884cbfd784a076bbc2469e916496fa53c6728 Mon Sep 17 00:00:00 2001
From: Russell Shaw <69813534+kiwi1969@users.noreply.github.com>
Date: Wed, 27 Mar 2024 11:23:01 -0400
Subject: [PATCH 09/29] Update TerseDecompress.java
Restored try clause.
Increased GZIP buffer size for effciency and for CryptoCards that only get used if buffer > = 8192 bytes
Set GZIP flush option to prevent corruption of file on last write
Signed-off-by: Russell Shaw <69813534+kiwi1969@users.noreply.github.com>
---
.../tersedecompress/TerseDecompress.java | 25 +++++++++++--------
1 file changed, 15 insertions(+), 10 deletions(-)
diff --git a/src/main/java/org/openmainframeproject/tersedecompress/TerseDecompress.java b/src/main/java/org/openmainframeproject/tersedecompress/TerseDecompress.java
index cf82829..c26c2ce 100644
--- a/src/main/java/org/openmainframeproject/tersedecompress/TerseDecompress.java
+++ b/src/main/java/org/openmainframeproject/tersedecompress/TerseDecompress.java
@@ -99,18 +99,23 @@ else if (outputFileName == null)
printUsageAndExit();
}
- TerseDecompresser outputWriter = null;
- FileOutputStream fileOutputStream = new FileOutputStream(outputFileName);
+ System.out.println("Attempting to decompress input file (" + inputFileName +") to output file (" + outputFileName +")");
- if (outputFileName.endsWith(".gz"))
- outputWriter = TerseDecompresser.create(new FileInputStream(inputFileName), new GZIPOutputStream(fileOutputStream));
- else
- outputWriter = TerseDecompresser.create(new FileInputStream(inputFileName), fileOutputStream);
+ if (outputFileName.endsWith(".gz")) {
+ try (TerseDecompresser outputWriter = TerseDecompresser.create(new FileInputStream(inputFileName), new GZIPOutputStream(new FileOutputStream(outputFileName), 8192, true)))
+ {
+ outputWriter.TextFlag = textMode;
+ outputWriter.decode();
+ }
+ }
+ else {
+ try (TerseDecompresser outputWriter = TerseDecompresser.create(new FileInputStream(inputFileName), new FileOutputStream(outputFileName)))
+ {
+ outputWriter.TextFlag = textMode;
+ outputWriter.decode();
+ }
+ }
- outputWriter.TextFlag = textMode;
- System.out.println("Attempting to decompress input file (" + inputFileName +") to output file (" + outputFileName +")");
- outputWriter.decode();
-
System.out.println("Processing completed");
}
From e0d6cd417010dc8a23f925b344d7cfcd9a93e9ef Mon Sep 17 00:00:00 2001
From: Russell Shaw <69813534+kiwi1969@users.noreply.github.com>
Date: Wed, 27 Mar 2024 17:20:39 -0400
Subject: [PATCH 10/29] Update TerseDecompress.java
Rebased upon existing 5.0.1 branch
Signed-off-by: Russell Shaw <69813534+kiwi1969@users.noreply.github.com>
---
.../tersedecompress/TerseDecompress.java | 49 ++++++++++++++-----
1 file changed, 38 insertions(+), 11 deletions(-)
diff --git a/src/main/java/org/openmainframeproject/tersedecompress/TerseDecompress.java b/src/main/java/org/openmainframeproject/tersedecompress/TerseDecompress.java
index c26c2ce..46c6529 100644
--- a/src/main/java/org/openmainframeproject/tersedecompress/TerseDecompress.java
+++ b/src/main/java/org/openmainframeproject/tersedecompress/TerseDecompress.java
@@ -34,9 +34,6 @@
/* Andrew Rowley, Black Hill Software */
/* Mario Bezzi, Watson Walker */
/*****************************************************************************/
-/* Version 6: support for gzipped output records */
-/* Russell Shaw */
-/*****************************************************************************/
import java.io.*;
import java.util.zip.GZIPOutputStream;
@@ -47,10 +44,17 @@ class TerseDecompress {
"Usage: \"TerseDecompress