mirror of
https://github.com/Maschell/JNUSLib.git
synced 2024-11-05 07:45:11 +01:00
Remove redundant code
This commit is contained in:
parent
69e0c8b36a
commit
a48f2c7547
@ -48,20 +48,6 @@ public class FSTDataProviderWUDDataPartition implements FSTDataProvider {
|
||||
return partition.getFST().getRoot();
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte[] readFile(FSTEntry entry, long offset, long size) throws IOException {
|
||||
ContentFSTInfo info = FSTUtils.getFSTInfoForContent(partition.getFST(), entry.getContentIndex())
|
||||
.orElseThrow(() -> new IOException("Failed to find FSTInfo"));
|
||||
return getChunkOfData(info.getOffset(), entry.getFileOffset() + offset, size, discReader, titleKey);
|
||||
}
|
||||
|
||||
public byte[] getChunkOfData(long contentOffset, long fileoffset, long size, WUDDiscReader discReader, byte[] titleKey) throws IOException {
|
||||
if (titleKey == null) {
|
||||
return discReader.readEncryptedToByteArray(partition.getPartitionOffset() + contentOffset, fileoffset, (int) size);
|
||||
}
|
||||
return discReader.readDecryptedToByteArray(partition.getPartitionOffset() + contentOffset, fileoffset, (int) size, titleKey, null, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean readFileToStream(OutputStream out, FSTEntry entry, long offset, long size) throws IOException {
|
||||
ContentFSTInfo info = FSTUtils.getFSTInfoForContent(partition.getFST(), entry.getContentIndex())
|
||||
|
@ -55,11 +55,6 @@ public class NUSDataProviderWUD implements NUSDataProvider {
|
||||
return getGamePartition().getPartitionOffset() + info.getOffset();
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte[] getChunkFromContent(Content content, long offset, int size) throws IOException {
|
||||
return discReader.readEncryptedToByteArray(getOffsetInWUD(content), offset, size);
|
||||
}
|
||||
|
||||
@Override
|
||||
public InputStream getInputStreamFromContent(Content content, long fileOffsetBlock, long size) throws IOException {
|
||||
WUDDiscReader discReader = getDiscReader();
|
||||
|
Loading…
Reference in New Issue
Block a user