/** * Write DebugInfo item into current section. * * @return real offset of item we've just written in this section. */ public int writeDebugInfoItem(DebugInfoItem debugInfoItem) { int off = data.position(); writeUleb128(debugInfoItem.lineStart); int parametersSize = debugInfoItem.parameterNames.length; writeUleb128(parametersSize); for (int i = 0; i < parametersSize; ++i) { int parameterName = debugInfoItem.parameterNames[i]; writeUleb128p1(parameterName); } write(debugInfoItem.infoSTM); return off; }
/** * Write EncodedValue/EncodedArray item into current section. * * @return real offset of item we've just written in this section. */ public int writeEncodedArray(EncodedValue encodedValue) { int off = data.position(); write(encodedValue.data); return off; } }
/** * Write String data into current section. * * @return real offset of item we've just written in this section. */ public int writeStringData(StringData stringData) { int off = data.position(); try { int length = stringData.value.length(); writeUleb128(length); write(Mutf8.encode(stringData.value)); writeByte(0); return off; } catch (UTFDataFormatException e) { throw new AssertionError(e); } }
writeInt(code.debugInfoOffset); writeInt(code.instructions.length); write(code.instructions);
private void writeResultToStream(OutputStream os) throws IOException { DexDataBuffer buffer = new DexDataBuffer(); buffer.write(DexPatchFile.MAGIC); buffer.writeShort(DexPatchFile.CURRENT_VERSION); buffer.writeInt(this.patchedDexSize); buffer.writeInt(this.patchedEncodedArrayItemsOffset); buffer.writeInt(this.patchedAnnotationsDirectoryItemsOffset); buffer.write(this.oldDex.computeSignature(false)); int firstChunkOffset = buffer.position(); buffer.position(posOfFirstChunkOffsetField);
writeInt(code.debugInfoOffset); writeInt(code.instructions.length); write(code.instructions);
private void writeResultToStream(OutputStream os) throws IOException { DexDataBuffer buffer = new DexDataBuffer(); buffer.write(DexPatchFile.MAGIC); buffer.writeShort(DexPatchFile.CURRENT_VERSION); buffer.writeInt(this.patchedDexSize); buffer.writeInt(this.patchedEncodedArrayItemsOffset); buffer.writeInt(this.patchedAnnotationsDirectoryItemsOffset); buffer.write(this.oldDex.computeSignature(false)); int firstChunkOffset = buffer.position(); buffer.position(posOfFirstChunkOffsetField);
/** * Write String data into current section. * * @return real offset of item we've just written in this section. */ public int writeStringData(StringData stringData) { int off = data.position(); try { int length = stringData.value.length(); writeUleb128(length); write(Mutf8.encode(stringData.value)); writeByte(0); return off; } catch (UTFDataFormatException e) { throw new AssertionError(e); } }
/** * Write DebugInfo item into current section. * * @return real offset of item we've just written in this section. */ public int writeDebugInfoItem(DebugInfoItem debugInfoItem) { int off = data.position(); writeUleb128(debugInfoItem.lineStart); int parametersSize = debugInfoItem.parameterNames.length; writeUleb128(parametersSize); for (int i = 0; i < parametersSize; ++i) { int parameterName = debugInfoItem.parameterNames[i]; writeUleb128p1(parameterName); } write(debugInfoItem.infoSTM); return off; }
/** * Write EncodedValue/EncodedArray item into current section. * * @return real offset of item we've just written in this section. */ public int writeEncodedArray(EncodedValue encodedValue) { int off = data.position(); write(encodedValue.data); return off; } }