Update readme, quick and small refactoring that doesn't make any impact on functionality.
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Dmitry Isaenko 2022-09-19 23:30:11 +03:00
parent 2ead991524
commit 5cd6d98ff9
3 changed files with 11 additions and 7 deletions

View file

@ -18,6 +18,10 @@ GNU GLPv3 or higher. Please see LICENSE.
Create new GitHub issue with bug report or proposition Create new GitHub issue with bug report or proposition
#### Thanks
* [DDinghoya](https://github.com/DDinghoya), who translated this application to Korean!
#### Translations #### 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` 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`

View file

@ -23,7 +23,7 @@ import java.nio.ByteOrder;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;
public class DirectoryEntry { public class DirectoryEntry {
private final int extentLocation; // lsb start private final int extentLocation; // lsb start
private final int dataSize; private final int dataSize;
private final String identifier; private final String identifier;

View file

@ -35,7 +35,7 @@ public class ISO9660 {
this.resourceBundle = ResourceBundle.getBundle("locale"); this.resourceBundle = ResourceBundle.getBundle("locale");
skipFirst16Sectors(); skipFirst16Sectors();
getRootDirectoryDescriptor(); getRootDirectoryDescriptor();
getSystemCnfContent(rootEntry); getSystemCnfContent();
} }
private void skipFirst16Sectors() throws Exception{ private void skipFirst16Sectors() throws Exception{
randomAccessFile.seek(2048*16); randomAccessFile.seek(2048*16);
@ -59,14 +59,14 @@ public class ISO9660 {
this.rootEntry = new DirectoryEntry(Arrays.copyOfRange(firstPayloadDescriptor, 0x9c, 0xbe)); this.rootEntry = new DirectoryEntry(Arrays.copyOfRange(firstPayloadDescriptor, 0x9c, 0xbe));
} }
private void getSystemCnfContent(DirectoryEntry entry) throws Exception{ private void getSystemCnfContent() throws Exception{
randomAccessFile.seek(entry.getExtentLocation() * 2048L); randomAccessFile.seek(rootEntry.getExtentLocation() * 2048L);
byte[] bytes = new byte[entry.getDataSize()]; byte[] bytes = new byte[rootEntry.getDataSize()];
if (entry.getDataSize() != randomAccessFile.read(bytes)) if (rootEntry.getDataSize() != randomAccessFile.read(bytes))
throw new Exception(resourceBundle.getString("ISO_CantReadRootDescriptor")); throw new Exception(resourceBundle.getString("ISO_CantReadRootDescriptor"));
int entryOffset = 0; int entryOffset = 0;
while (entryOffset < entry.getDataSize()){ while (entryOffset < rootEntry.getDataSize()){
int entryLength = Byte.toUnsignedInt(bytes[entryOffset]); int entryLength = Byte.toUnsignedInt(bytes[entryOffset]);
if (entryLength == 0) if (entryLength == 0)