Added getChunkFromContent function to "NUSDataProvider" class for getting chunks of a content file

This commit is contained in:
Maschell 2019-04-06 16:47:02 +02:00
parent 8d6c6b8691
commit a0ce50a4b5

View File

@ -26,6 +26,7 @@ import de.mas.wiiu.jnus.Settings;
import de.mas.wiiu.jnus.entities.content.Content;
import de.mas.wiiu.jnus.utils.FileUtils;
import de.mas.wiiu.jnus.utils.HashUtil;
import de.mas.wiiu.jnus.utils.StreamUtils;
import de.mas.wiiu.jnus.utils.Utils;
import lombok.Getter;
import lombok.NonNull;
@ -153,6 +154,10 @@ public abstract class NUSDataProvider {
}
public byte[] getChunkFromContent(Content content, long offset, int size) throws IOException {
return StreamUtils.getBytesFromStream(getInputStreamFromContent(content, offset), size);
}
/**
*
* @param content