Remove redundant code

This commit is contained in:
Maschell 2019-04-26 13:45:24 +02:00
parent 69e0c8b36a
commit a48f2c7547
2 changed files with 0 additions and 19 deletions

View File

@ -48,20 +48,6 @@ public class FSTDataProviderWUDDataPartition implements FSTDataProvider {
return partition.getFST().getRoot(); 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 @Override
public boolean readFileToStream(OutputStream out, FSTEntry entry, long offset, long size) throws IOException { public boolean readFileToStream(OutputStream out, FSTEntry entry, long offset, long size) throws IOException {
ContentFSTInfo info = FSTUtils.getFSTInfoForContent(partition.getFST(), entry.getContentIndex()) ContentFSTInfo info = FSTUtils.getFSTInfoForContent(partition.getFST(), entry.getContentIndex())

View File

@ -55,11 +55,6 @@ public class NUSDataProviderWUD implements NUSDataProvider {
return getGamePartition().getPartitionOffset() + info.getOffset(); 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 @Override
public InputStream getInputStreamFromContent(Content content, long fileOffsetBlock, long size) throws IOException { public InputStream getInputStreamFromContent(Content content, long fileOffsetBlock, long size) throws IOException {
WUDDiscReader discReader = getDiscReader(); WUDDiscReader discReader = getDiscReader();