From 0ed359a43a905261479bc59bd8b08d5f19945b70 Mon Sep 17 00:00:00 2001 From: Maschell Date: Sat, 4 May 2019 11:11:36 +0200 Subject: [PATCH] Add default readFileToStream function wthout offset/size --- src/de/mas/wiiu/jnus/DecryptionService.java | 2 +- src/de/mas/wiiu/jnus/interfaces/FSTDataProvider.java | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/de/mas/wiiu/jnus/DecryptionService.java b/src/de/mas/wiiu/jnus/DecryptionService.java index 611cb0f..6184925 100644 --- a/src/de/mas/wiiu/jnus/DecryptionService.java +++ b/src/de/mas/wiiu/jnus/DecryptionService.java @@ -116,7 +116,7 @@ public final class DecryptionService { } public void decryptFSTEntryToStream(FSTEntry entry, OutputStream outputStream) throws IOException { - dataProvider.readFileToStream(outputStream, entry, 0); + dataProvider.readFileToStream(outputStream, entry); } // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! diff --git a/src/de/mas/wiiu/jnus/interfaces/FSTDataProvider.java b/src/de/mas/wiiu/jnus/interfaces/FSTDataProvider.java index 42446da..5aee03f 100644 --- a/src/de/mas/wiiu/jnus/interfaces/FSTDataProvider.java +++ b/src/de/mas/wiiu/jnus/interfaces/FSTDataProvider.java @@ -62,6 +62,10 @@ public interface FSTDataProvider { return in; } + default public boolean readFileToStream(OutputStream out, FSTEntry entry) throws IOException { + return readFileToStream(out, entry, 0, entry.getFileSize()); + } + default public boolean readFileToStream(OutputStream out, FSTEntry entry, long offset) throws IOException { return readFileToStream(out, entry, offset, entry.getFileSize()); }