本文整理汇总了Java中brut.util.ExtDataInput类的典型用法代码示例。如果您正苦于以下问题:Java ExtDataInput类的具体用法?Java ExtDataInput怎么用?Java ExtDataInput使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ExtDataInput类属于brut.util包,在下文中一共展示了ExtDataInput类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: decode
import brut.util.ExtDataInput; //导入依赖的package包/类
public static NinePatch decode(ExtDataInput di) throws IOException {
di.skipBytes(1);
byte numXDivs = di.readByte();
byte numYDivs = di.readByte();
di.skipBytes(1);
di.skipBytes(8);
int padLeft = di.readInt();
int padRight = di.readInt();
int padTop = di.readInt();
int padBottom = di.readInt();
di.skipBytes(4);
int[] xDivs = di.readIntArray(numXDivs);
int[] yDivs = di.readIntArray(numYDivs);
return new NinePatch(padLeft, padRight, padTop, padBottom, xDivs,
yDivs);
}
示例2: decode
import brut.util.ExtDataInput; //导入依赖的package包/类
public static NinePatch decode(ExtDataInput di) throws IOException {
di.skipBytes(1);
byte numXDivs = di.readByte();
byte numYDivs = di.readByte();
di.skipBytes(1);
di.skipBytes(8);
int padLeft = di.readInt();
int padRight = di.readInt();
int padTop = di.readInt();
int padBottom = di.readInt();
di.skipBytes(4);
int[] xDivs = di.readIntArray(numXDivs);
int[] yDivs = di.readIntArray(numYDivs);
return new NinePatch(padLeft, padRight, padTop, padBottom, xDivs,
yDivs);
}
示例3: ARSCDecoder
import brut.util.ExtDataInput; //导入依赖的package包/类
private ARSCDecoder(InputStream arscStream, ResTable resTable, boolean storeFlagsOffsets, boolean keepBroken) {
arscStream = mCountIn = new CountingInputStream(arscStream);
if (storeFlagsOffsets) {
mFlagsOffsets = new ArrayList<FlagsOffset>();
} else {
mFlagsOffsets = null;
}
mIn = new ExtDataInput(new LittleEndianDataInputStream(arscStream));
mResTable = resTable;
mKeepBroken = keepBroken;
}
示例4: read
import brut.util.ExtDataInput; //导入依赖的package包/类
public static Header read(ExtDataInput in, CountingInputStream countIn) throws IOException {
short type;
int start = countIn.getCount();
try {
type = in.readShort();
} catch (EOFException ex) {
return new Header(TYPE_NONE, 0, 0, countIn.getCount());
}
return new Header(type, in.readShort(), in.readInt(), start);
}
示例5: ARSCDecoder
import brut.util.ExtDataInput; //导入依赖的package包/类
private ARSCDecoder(InputStream arscStream, ResTable resTable,
boolean storeFlagsOffsets, boolean keepBroken) {
if (storeFlagsOffsets) {
arscStream = mCountIn = new CountingInputStream(arscStream);
mFlagsOffsets = new ArrayList<FlagsOffset>();
} else {
mCountIn = null;
mFlagsOffsets = null;
}
mIn = new ExtDataInput(new LEDataInputStream(arscStream));
mResTable = resTable;
mKeepBroken = keepBroken;
}
示例6: read
import brut.util.ExtDataInput; //导入依赖的package包/类
public static Header read(ExtDataInput in) throws IOException {
short type;
try {
type = in.readShort();
} catch (EOFException ex) {
return new Header(TYPE_NONE, 0);
}
in.skipBytes(2);
return new Header(type, in.readInt());
}
示例7: getNinePatch
import brut.util.ExtDataInput; //导入依赖的package包/类
private NinePatch getNinePatch(byte[] data) throws AndrolibException,
IOException {
ExtDataInput di = new ExtDataInput(new ByteArrayInputStream(data));
find9patchChunk(di);
return NinePatch.decode(di);
}
示例8: read
import brut.util.ExtDataInput; //导入依赖的package包/类
/**
* Reads whole (including chunk type) string block from stream. Stream must
* be at the chunk type.
*/
public static StringBlock read(ExtDataInput reader) throws IOException {
reader.skipCheckChunkTypeInt(CHUNK_STRINGPOOL_TYPE, CHUNK_NULL_TYPE);
int chunkSize = reader.readInt();
// ResStringPool_header
int stringCount = reader.readInt();
int styleCount = reader.readInt();
int flags = reader.readInt();
int stringsOffset = reader.readInt();
int stylesOffset = reader.readInt();
StringBlock block = new StringBlock();
block.m_isUTF8 = (flags & UTF8_FLAG) != 0;
block.m_stringOffsets = reader.readIntArray(stringCount);
block.m_stringOwns = new int[stringCount];
Arrays.fill(block.m_stringOwns, -1);
if (styleCount != 0) {
block.m_styleOffsets = reader.readIntArray(styleCount);
}
int size = ((stylesOffset == 0) ? chunkSize : stylesOffset) - stringsOffset;
block.m_strings = new byte[size];
reader.readFully(block.m_strings);
if (stylesOffset != 0) {
size = (chunkSize - stylesOffset);
block.m_styles = reader.readIntArray(size / 4);
// read remaining bytes
int remaining = size % 4;
if (remaining >= 1) {
while (remaining-- > 0) {
reader.readByte();
}
}
}
return block;
}
示例9: open
import brut.util.ExtDataInput; //导入依赖的package包/类
public void open(InputStream stream) {
close();
if (stream != null) {
m_reader = new ExtDataInput(new LittleEndianDataInputStream(stream));
}
}
示例10: getNinePatch
import brut.util.ExtDataInput; //导入依赖的package包/类
private NinePatch getNinePatch(byte[] data) throws AndrolibException,
IOException {
ExtDataInput di = new ExtDataInput(new ByteArrayInputStream(data));
find9patchChunk(di);
return NinePatch.decode(di);
}
示例11: open
import brut.util.ExtDataInput; //导入依赖的package包/类
public void open(InputStream stream) {
close();
if (stream != null) {
m_reader = new ExtDataInput(new LEDataInputStream(stream));
}
}
示例12: getNinePatch
import brut.util.ExtDataInput; //导入依赖的package包/类
public static NinePatch getNinePatch(byte[] data) throws AndrolibException,
IOException {
ExtDataInput di = new ExtDataInput(new ByteArrayInputStream(data));
find9patchChunk(di);
return NinePatch.decode(di);
}