mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-09-27 11:10:50 +00:00
Memory input stream (Simplified version of ReReadableInputStream, which accepts byte array)
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
*/
|
||||
package com.jpexs.helpers;
|
||||
|
||||
import com.jpexs.helpers.streams.SeekableInputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
@@ -24,7 +25,7 @@ import java.io.InputStream;
|
||||
*
|
||||
* @author JPEXS
|
||||
*/
|
||||
public class ReReadableInputStream extends InputStream {
|
||||
public class ReReadableInputStream extends SeekableInputStream {
|
||||
|
||||
InputStream is;
|
||||
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||
@@ -48,7 +49,8 @@ public class ReReadableInputStream extends InputStream {
|
||||
this.is = is;
|
||||
}
|
||||
|
||||
public void setPos(long pos) throws IOException {
|
||||
@Override
|
||||
public void seek(long pos) throws IOException {
|
||||
if (pos > count) {
|
||||
this.pos = count;
|
||||
skip(pos - count);
|
||||
|
||||
Reference in New Issue
Block a user