本文整理汇总了Java中com.android.dx.cf.direct.DirectClassFile.setObserver方法的典型用法代码示例。如果您正苦于以下问题:Java DirectClassFile.setObserver方法的具体用法?Java DirectClassFile.setObserver怎么用?Java DirectClassFile.setObserver使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.android.dx.cf.direct.DirectClassFile
的用法示例。
在下文中一共展示了DirectClassFile.setObserver方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: dump
import com.android.dx.cf.direct.DirectClassFile; //导入方法依赖的package包/类
/**
* Does the dumping.
*/
public void dump() {
byte[] bytes = getBytes();
ByteArray ba = new ByteArray(bytes);
DirectClassFile cf =
new DirectClassFile(ba, getFilePath(), getStrictParse());
cf.setAttributeFactory(StdAttributeFactory.THE_ONE);
cf.setObserver(this);
cf.getMagic(); // Force parsing to happen.
int at = getAt();
if (at != bytes.length) {
parsed(ba, at, bytes.length - at, "<extra data at end of file>");
}
}
示例2: dump
import com.android.dx.cf.direct.DirectClassFile; //导入方法依赖的package包/类
/**
* Does the dumping.
*/
public void dump() {
byte[] bytes = getBytes();
ByteArray ba = new ByteArray(bytes);
/*
* First, parse the file completely, so we can safely refer to
* attributes, etc.
*/
classFile = new DirectClassFile(ba, getFilePath(), getStrictParse());
classFile.setAttributeFactory(StdAttributeFactory.THE_ONE);
classFile.getMagic(); // Force parsing to happen.
// Next, reparse it and observe the process.
DirectClassFile liveCf =
new DirectClassFile(ba, getFilePath(), getStrictParse());
liveCf.setAttributeFactory(StdAttributeFactory.THE_ONE);
liveCf.setObserver(this);
liveCf.getMagic(); // Force parsing to happen.
}
示例3: run
import com.android.dx.cf.direct.DirectClassFile; //导入方法依赖的package包/类
private void run() {
ByteArray ba = new ByteArray(bytes);
/*
* First, parse the file completely, so we can safely refer to
* attributes, etc.
*/
classFile = new DirectClassFile(ba, filePath, strictParse);
classFile.setAttributeFactory(StdAttributeFactory.THE_ONE);
classFile.getMagic(); // Force parsing to happen.
// Next, reparse it and observe the process.
DirectClassFile liveCf =
new DirectClassFile(ba, filePath, strictParse);
liveCf.setAttributeFactory(StdAttributeFactory.THE_ONE);
liveCf.setObserver(this);
liveCf.getMagic(); // Force parsing to happen.
}