com.android.dx.io
Class DexBuffer

java.lang.Object
  extended by com.android.dx.io.DexBuffer

public final class DexBuffer
extends Object

The bytes of a dex file in memory for reading and writing. All int offsets are unsigned.


Nested Class Summary
 class DexBuffer.Section
           
 
Constructor Summary
DexBuffer()
          Creates a new dex buffer defining no classes.
DexBuffer(byte[] data)
          Creates a new dex buffer that reads from data.
DexBuffer(File file)
          Creates a new dex buffer from the dex file file.
DexBuffer(InputStream in)
          Creates a new dex buffer of the dex in in, and closes in.
 
Method Summary
 DexBuffer.Section appendSection(int maxByteCount, String name)
           
 Iterable<ClassDef> classDefs()
           
 List<FieldId> fieldIds()
           
 byte[] getBytes()
           
 int getLength()
           
 TableOfContents getTableOfContents()
           
 List<MethodId> methodIds()
           
 void noMoreSections()
           
 DexBuffer.Section open(int position)
           
 List<ProtoId> protoIds()
           
 ClassData readClassData(ClassDef classDef)
           
 Code readCode(ClassData.Method method)
           
 TypeList readTypeList(int offset)
           
 List<String> strings()
           
 List<Integer> typeIds()
           
 List<String> typeNames()
           
 void writeTo(File dexOut)
           
 void writeTo(OutputStream out)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DexBuffer

public DexBuffer()
Creates a new dex buffer defining no classes.


DexBuffer

public DexBuffer(byte[] data)
          throws IOException
Creates a new dex buffer that reads from data. It is an error to modify data after using it to create a dex buffer.

Throws:
IOException

DexBuffer

public DexBuffer(InputStream in)
          throws IOException
Creates a new dex buffer of the dex in in, and closes in.

Throws:
IOException

DexBuffer

public DexBuffer(File file)
          throws IOException
Creates a new dex buffer from the dex file file.

Throws:
IOException
Method Detail

writeTo

public void writeTo(OutputStream out)
             throws IOException
Throws:
IOException

writeTo

public void writeTo(File dexOut)
             throws IOException
Throws:
IOException

getTableOfContents

public TableOfContents getTableOfContents()

open

public DexBuffer.Section open(int position)

appendSection

public DexBuffer.Section appendSection(int maxByteCount,
                                       String name)

noMoreSections

public void noMoreSections()

getLength

public int getLength()

getBytes

public byte[] getBytes()

strings

public List<String> strings()

typeIds

public List<Integer> typeIds()

typeNames

public List<String> typeNames()

protoIds

public List<ProtoId> protoIds()

fieldIds

public List<FieldId> fieldIds()

methodIds

public List<MethodId> methodIds()

classDefs

public Iterable<ClassDef> classDefs()

readTypeList

public TypeList readTypeList(int offset)

readClassData

public ClassData readClassData(ClassDef classDef)

readCode

public Code readCode(ClassData.Method method)


Copyright © 2012. All Rights Reserved.