From 5cd6d98ff9fcc17585735dca272aae14530e4321 Mon Sep 17 00:00:00 2001 From: Dmitry Isaenko Date: Mon, 19 Sep 2022 23:30:11 +0300 Subject: [PATCH] Update readme, quick and small refactoring that doesn't make any impact on functionality. --- README.md | 4 ++++ src/main/java/tihwin/cd/DirectoryEntry.java | 2 +- src/main/java/tihwin/cd/ISO9660.java | 12 ++++++------ 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index d041158..07ce09c 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,10 @@ GNU GLPv3 or higher. Please see LICENSE. Create new GitHub issue with bug report or proposition +#### Thanks + +* [DDinghoya](https://github.com/DDinghoya), who translated this application to Korean! + #### Translations Everyone knows that [your_language_here] is the best! And just to make sure, go create PR (pull request) or create an issue with translated `.../src/main/resources/locale.properties` diff --git a/src/main/java/tihwin/cd/DirectoryEntry.java b/src/main/java/tihwin/cd/DirectoryEntry.java index 868c821..f759abe 100644 --- a/src/main/java/tihwin/cd/DirectoryEntry.java +++ b/src/main/java/tihwin/cd/DirectoryEntry.java @@ -23,7 +23,7 @@ import java.nio.ByteOrder; import java.nio.charset.StandardCharsets; public class DirectoryEntry { - private final int extentLocation; // lsb start + private final int extentLocation; // lsb start private final int dataSize; private final String identifier; diff --git a/src/main/java/tihwin/cd/ISO9660.java b/src/main/java/tihwin/cd/ISO9660.java index 2772f87..bd2badf 100644 --- a/src/main/java/tihwin/cd/ISO9660.java +++ b/src/main/java/tihwin/cd/ISO9660.java @@ -35,7 +35,7 @@ public class ISO9660 { this.resourceBundle = ResourceBundle.getBundle("locale"); skipFirst16Sectors(); getRootDirectoryDescriptor(); - getSystemCnfContent(rootEntry); + getSystemCnfContent(); } private void skipFirst16Sectors() throws Exception{ randomAccessFile.seek(2048*16); @@ -59,14 +59,14 @@ public class ISO9660 { this.rootEntry = new DirectoryEntry(Arrays.copyOfRange(firstPayloadDescriptor, 0x9c, 0xbe)); } - private void getSystemCnfContent(DirectoryEntry entry) throws Exception{ - randomAccessFile.seek(entry.getExtentLocation() * 2048L); - byte[] bytes = new byte[entry.getDataSize()]; - if (entry.getDataSize() != randomAccessFile.read(bytes)) + private void getSystemCnfContent() throws Exception{ + randomAccessFile.seek(rootEntry.getExtentLocation() * 2048L); + byte[] bytes = new byte[rootEntry.getDataSize()]; + if (rootEntry.getDataSize() != randomAccessFile.read(bytes)) throw new Exception(resourceBundle.getString("ISO_CantReadRootDescriptor")); int entryOffset = 0; - while (entryOffset < entry.getDataSize()){ + while (entryOffset < rootEntry.getDataSize()){ int entryLength = Byte.toUnsignedInt(bytes[entryOffset]); if (entryLength == 0)