Skip to content

Commit 31b9d7e

Browse files
committed
Add abstract skip method to InputSource
1 parent 342d4e6 commit 31b9d7e

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

‎src/main/java/org/glavo/nbt/internal/input/InputSource.java‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ public final void fillBuffer(InputBuffer buffer, int required) throws IOExceptio
7171

7272
protected abstract void fillBufferImpl(ByteBuffer target, int required) throws IOException;
7373

74+
public abstract void skip(long bytes) throws IOException;
75+
7476
public static final class OfInputStream extends InputSource {
7577
private final InputStream inputStream;
7678
private final boolean closeInputStream;
@@ -109,5 +111,10 @@ protected void fillBufferImpl(ByteBuffer target, int required) throws IOExceptio
109111
position += read;
110112
}
111113
}
114+
115+
@Override
116+
public void skip(long bytes) throws IOException {
117+
inputStream.skipNBytes(bytes);
118+
}
112119
}
113120
}

0 commit comments

Comments
 (0)