public void writeUnsignedShort(int i) { short s = (short) i; if (i != (s & 0xffff)) { throw new IllegalArgumentException("Expected an unsigned short: " + i); } writeShort(s); }
public void write(short[] shorts) { ensureBufferSize(shorts.length * SizeOf.USHORT); for (short s : shorts) { writeShort(s); } if (this.data.position() > this.dataBound) { this.dataBound = this.data.position(); } }
/** * Write TypeList item into current section. * * @return real offset of item we've just written in this section. */ public int writeTypeList(TypeList typeList) { int off = data.position(); short[] types = typeList.types; writeInt(types.length); for (short type : types) { writeShort(type); } return off; }
writeShort((short) 0); // padding
private void writeResultToStream(OutputStream os) throws IOException { DexDataBuffer buffer = new DexDataBuffer(); buffer.write(DexPatchFile.MAGIC); buffer.writeShort(DexPatchFile.CURRENT_VERSION); buffer.writeInt(this.patchedDexSize);
public void writeUnsignedShort(int i) { short s = (short) i; if (i != (s & 0xffff)) { throw new IllegalArgumentException("Expected an unsigned short: " + i); } writeShort(s); }
public void write(short[] shorts) { ensureBufferSize(shorts.length * SizeOf.USHORT); for (short s : shorts) { writeShort(s); } if (this.data.position() > this.dataBound) { this.dataBound = this.data.position(); } }
/** * Write TypeList item into current section. * * @return real offset of item we've just written in this section. */ public int writeTypeList(TypeList typeList) { int off = data.position(); short[] types = typeList.types; writeInt(types.length); for (short type : types) { writeShort(type); } return off; }
writeShort((short) 0); // padding
private void writeResultToStream(OutputStream os) throws IOException { DexDataBuffer buffer = new DexDataBuffer(); buffer.write(DexPatchFile.MAGIC); buffer.writeShort(DexPatchFile.CURRENT_VERSION); buffer.writeInt(this.patchedDexSize);