我有一个从遗留系统中提取的庞大的大型机文件 . 该文件以ascii格式编码 . 我想将其转换为comp3 . java中是否有可用的算法来做到这一点?另外,我需要有关如何解压缩comp3字段的帮助 . 我尝试了一个java代码解压缩comp3但我发现不正确的结果
请参阅代码以解压缩comp3字段
import java.math.BigInteger;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
/**
* Converts between integer and an array of bytes in IBM mainframe packed
* decimal format. The number of bytes required to store an integer is (digits +
* 1) / 2. For example, a 7 digit number can be stored in 4 bytes. Each pair of
* digits is packed into the two nibbles of one byte. The last nibble contains
* the sign, 0F for positive and 0C for negative. For example 7654321 becomes
* 0x76 0x54 0x32 0x1F.
**/
public class PackedDecimalToComp {
public static void main(String[] args) {
try {
// test.u