mirror of
https://github.com/Maschell/JNUSLib.git
synced 2024-11-22 16:09:18 +01:00
Add simple wrapper for the "readFileAsStream" function of the FSTDataProvider
This commit is contained in:
parent
151ad6e2a6
commit
54536f29ab
@ -36,6 +36,11 @@ public interface FSTDataProvider {
|
||||
|
||||
public byte[] readFile(FSTEntry entry, long offset, long size) throws IOException;
|
||||
|
||||
|
||||
default public InputStream readFileAsStream(FSTEntry entry) throws IOException {
|
||||
return readFileAsStream(entry, 0, Optional.empty());
|
||||
}
|
||||
|
||||
default public InputStream readFileAsStream(FSTEntry entry, long offset, Optional<Long> size) throws IOException {
|
||||
PipedInputStreamWithException in = new PipedInputStreamWithException();
|
||||
PipedOutputStream out = new PipedOutputStream(in);
|
||||
@ -58,4 +63,6 @@ public interface FSTDataProvider {
|
||||
|
||||
public void readFileToStream(OutputStream out, FSTEntry entry, long offset, Optional<Long> size) throws IOException;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user