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
#### 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`

View file

@ -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)