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

master
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

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

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)