-
Notifications
You must be signed in to change notification settings - Fork 264
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:leibnitz27/cfr
- Loading branch information
Showing
14 changed files
with
178 additions
and
142 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,23 @@ | ||
package org.benf.cfr.reader.util.bytestream; | ||
|
||
import java.io.ByteArrayInputStream; | ||
import java.io.DataInputStream; | ||
|
||
public class BaseByteData extends AbstractBackedByteData { | ||
private final byte[] data; | ||
|
||
public BaseByteData(byte[] data) { | ||
this.data = data; | ||
} | ||
|
||
@Override | ||
public DataInputStream rawDataAsStream(int start, int len) { | ||
return new DataInputStream(new ByteArrayInputStream(data, start, len)); | ||
super(data); | ||
} | ||
|
||
@Override | ||
public ByteData getOffsetData(long offset) { | ||
return new OffsetBackedByteData(data, offset); | ||
return new OffsetBackedByteData(d, offset); | ||
} | ||
|
||
@Override | ||
public OffsettingByteData getOffsettingOffsetData(long offset) { | ||
return new OffsettingBackedByteData(data, offset); | ||
} | ||
|
||
@Override | ||
public byte[] getBytesAt(int count, long offset) { | ||
byte[] res = new byte[count]; | ||
System.arraycopy(data, (int) offset, res, 0, count); | ||
return res; | ||
return new OffsettingBackedByteData(d, offset); | ||
} | ||
|
||
@Override | ||
public byte getS1At(long o) { | ||
return data[(int) o]; | ||
int getRealOffset(int offset) { | ||
return offset; | ||
} | ||
|
||
} |
Oops, something went wrong.