RangeInputByteStream.java
1.77 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/*
* Decompiled with CFR 0_118.
*/
package com.adobe.internal.io.stream;
import com.adobe.internal.io.stream.ChainedInputByteStream;
import com.adobe.internal.io.stream.InputByteStream;
import com.adobe.internal.io.stream.InputByteStreamImpl;
import java.io.IOException;
public class RangeInputByteStream
extends InputByteStreamImpl {
private ChainedInputByteStream chainedIBS;
private long[] ranges;
public RangeInputByteStream(InputByteStream ibs, long[] ranges) throws IOException {
InputByteStream[] ibsArray = new InputByteStream[]{ibs.slice(ranges[0], ranges[1]), ibs.slice(ranges[2], ranges[3])};
this.chainedIBS = new ChainedInputByteStream(ibsArray);
this.ranges = ranges;
}
@Override
public void close() throws IOException {
this.chainedIBS.close();
this.chainedIBS = null;
}
@Override
public long getPosition() throws IOException {
return this.chainedIBS.getPosition();
}
@Override
public long length() throws IOException {
return this.chainedIBS.length();
}
@Override
public int read() throws IOException {
return this.chainedIBS.read();
}
@Override
public int read(byte[] bytes, int position, int length) throws IOException {
return this.chainedIBS.read(bytes, position, length);
}
@Override
public InputByteStream seek(long position) throws IOException {
this.chainedIBS.seek(position);
return this;
}
@Override
public InputByteStream slice(long begin, long length) throws IOException {
return this.chainedIBS.slice(begin, length);
}
public ChainedInputByteStream getChainedIBS() {
return this.chainedIBS;
}
public long[] getRanges() {
return this.ranges;
}
}