RangedByteWriter.java
1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/*
* Decompiled with CFR 0_118.
*/
package com.adobe.internal.io;
import com.adobe.internal.io.ByteWriter;
import com.adobe.internal.io.FilterByteWriter;
import java.io.IOException;
public class RangedByteWriter
extends FilterByteWriter {
private final long start;
public RangedByteWriter(ByteWriter byteWriter, long offset) {
super(byteWriter);
this.start = offset;
}
@Override
public long length() throws IOException {
return Math.max(super.length() - this.start, 0);
}
@Override
public int read(long position, byte[] b, int offset, int length) throws IOException {
return super.read(position + this.start, b, offset, length);
}
@Override
public int read(long position) throws IOException {
return super.read(position + this.start);
}
@Override
public void write(long position, byte[] b, int offset, int length) throws IOException {
super.write(position + this.start, b, offset, length);
}
@Override
public void write(long position, int b) throws IOException {
super.write(position + this.start, b);
}
}