mirror of
https://github.com/revanced/smali.git
synced 2025-05-29 04:10:13 +02:00
MemoryDataStore: Fail fast on invalid offsets
This commit is contained in:
parent
c41c24a0c2
commit
f1c116241a
@ -31,6 +31,7 @@ public class MemoryDataStore implements DexDataStore {
|
||||
}
|
||||
|
||||
@Nonnull @Override public OutputStream outputAt(final int offset) {
|
||||
if (offset < 0) throw new IllegalArgumentException();
|
||||
return new OutputStream() {
|
||||
private int position = offset;
|
||||
@Override public void write(int b) throws IOException {
|
||||
@ -68,6 +69,7 @@ public class MemoryDataStore implements DexDataStore {
|
||||
}
|
||||
|
||||
@Nonnull @Override public InputStream readAt(final int offset) {
|
||||
if (offset < 0) throw new IllegalArgumentException();
|
||||
return new InputStream() {
|
||||
private int position = offset;
|
||||
private int mark = offset;
|
||||
|
Loading…
x
Reference in New Issue
Block a user