Package org.jf.dexlib2.formatter
Class DexFormattedWriter
- java.lang.Object
-
- java.io.Writer
-
- org.jf.dexlib2.formatter.DexFormattedWriter
-
- All Implemented Interfaces:
java.io.Closeable
,java.io.Flushable
,java.lang.Appendable
,java.lang.AutoCloseable
public class DexFormattedWriter extends java.io.Writer
This class handles formatting and writing various types of items in a dex file to a Writer.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.io.Writer
writer
-
Constructor Summary
Constructors Constructor Description DexFormattedWriter(java.io.Writer writer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.io.Writer
append(char c)
java.io.Writer
append(java.lang.CharSequence csq)
java.io.Writer
append(java.lang.CharSequence csq, int start, int end)
void
close()
void
flush()
void
write(char[] cbuf)
void
write(char[] cbuf, int off, int len)
void
write(int c)
void
write(java.lang.String str)
void
write(java.lang.String str, int off, int len)
protected void
writeAnnotation(AnnotationEncodedValue annotation)
Write the givenAnnotationEncodedValue
.protected void
writeArray(ArrayEncodedValue array)
Write the givenArrayEncodedValue
.void
writeCallSite(CallSiteReference callSiteReference)
Write the givenCallSiteReference
.protected void
writeClass(java.lang.CharSequence type)
void
writeEncodedValue(EncodedValue encodedValue)
Write the givenEncodedValue
.void
writeFieldDescriptor(FieldReference fieldReference)
Write the field descriptor for the givenFieldReference
.void
writeMethodDescriptor(MethodReference methodReference)
Write the method descriptor for the givenMethodReference
.void
writeMethodHandle(MethodHandleReference methodHandleReference)
Write the givenMethodHandleReference
.void
writeMethodProtoDescriptor(MethodProtoReference protoReference)
Write the method proto descriptor for the givenMethodProtoReference
.void
writeQuotedString(java.lang.CharSequence charSequence)
Write the given quoted string.void
writeReference(Reference reference)
Write the givenReference
.void
writeShortFieldDescriptor(FieldReference fieldReference)
Write the short field descriptor for the givenFieldReference
.void
writeShortMethodDescriptor(MethodReference methodReference)
Write the short method descriptor for the givenMethodReference
.protected void
writeSimpleName(java.lang.CharSequence simpleName)
Writes the given simple name.void
writeType(java.lang.CharSequence type)
Write the given type.
-
-
-
Method Detail
-
writeMethodDescriptor
public void writeMethodDescriptor(MethodReference methodReference) throws java.io.IOException
Write the method descriptor for the givenMethodReference
.- Throws:
java.io.IOException
-
writeShortMethodDescriptor
public void writeShortMethodDescriptor(MethodReference methodReference) throws java.io.IOException
Write the short method descriptor for the givenMethodReference
.The short method descriptor elides the class that the field is a member of.
- Throws:
java.io.IOException
-
writeMethodProtoDescriptor
public void writeMethodProtoDescriptor(MethodProtoReference protoReference) throws java.io.IOException
Write the method proto descriptor for the givenMethodProtoReference
.- Throws:
java.io.IOException
-
writeFieldDescriptor
public void writeFieldDescriptor(FieldReference fieldReference) throws java.io.IOException
Write the field descriptor for the givenFieldReference
.- Throws:
java.io.IOException
-
writeShortFieldDescriptor
public void writeShortFieldDescriptor(FieldReference fieldReference) throws java.io.IOException
Write the short field descriptor for the givenFieldReference
.The short field descriptor typically elides the class that the field is a member of.
- Throws:
java.io.IOException
-
writeMethodHandle
public void writeMethodHandle(MethodHandleReference methodHandleReference) throws java.io.IOException
Write the givenMethodHandleReference
.- Throws:
java.io.IOException
-
writeCallSite
public void writeCallSite(CallSiteReference callSiteReference) throws java.io.IOException
Write the givenCallSiteReference
.- Throws:
java.io.IOException
-
writeType
public void writeType(java.lang.CharSequence type) throws java.io.IOException
Write the given type.- Throws:
java.io.IOException
-
writeClass
protected void writeClass(java.lang.CharSequence type) throws java.io.IOException
- Throws:
java.io.IOException
-
writeSimpleName
protected void writeSimpleName(java.lang.CharSequence simpleName) throws java.io.IOException
Writes the given simple name.- Parameters:
simpleName
- The simple name to write.- Throws:
java.io.IOException
-
writeQuotedString
public void writeQuotedString(java.lang.CharSequence charSequence) throws java.io.IOException
Write the given quoted string.This includes the beginning and ending quotation marks, and the string value is be escaped as necessary.
- Throws:
java.io.IOException
-
writeEncodedValue
public void writeEncodedValue(EncodedValue encodedValue) throws java.io.IOException
Write the givenEncodedValue
.- Throws:
java.io.IOException
-
writeAnnotation
protected void writeAnnotation(AnnotationEncodedValue annotation) throws java.io.IOException
Write the givenAnnotationEncodedValue
.- Throws:
java.io.IOException
-
writeArray
protected void writeArray(ArrayEncodedValue array) throws java.io.IOException
Write the givenArrayEncodedValue
.- Throws:
java.io.IOException
-
writeReference
public void writeReference(Reference reference) throws java.io.IOException
Write the givenReference
.- Throws:
java.io.IOException
-
write
public void write(int c) throws java.io.IOException
- Overrides:
write
in classjava.io.Writer
- Throws:
java.io.IOException
-
write
public void write(char[] cbuf) throws java.io.IOException
- Overrides:
write
in classjava.io.Writer
- Throws:
java.io.IOException
-
write
public void write(char[] cbuf, int off, int len) throws java.io.IOException
- Specified by:
write
in classjava.io.Writer
- Throws:
java.io.IOException
-
write
public void write(java.lang.String str) throws java.io.IOException
- Overrides:
write
in classjava.io.Writer
- Throws:
java.io.IOException
-
write
public void write(java.lang.String str, int off, int len) throws java.io.IOException
- Overrides:
write
in classjava.io.Writer
- Throws:
java.io.IOException
-
append
public java.io.Writer append(java.lang.CharSequence csq) throws java.io.IOException
- Specified by:
append
in interfacejava.lang.Appendable
- Overrides:
append
in classjava.io.Writer
- Throws:
java.io.IOException
-
append
public java.io.Writer append(java.lang.CharSequence csq, int start, int end) throws java.io.IOException
- Specified by:
append
in interfacejava.lang.Appendable
- Overrides:
append
in classjava.io.Writer
- Throws:
java.io.IOException
-
append
public java.io.Writer append(char c) throws java.io.IOException
- Specified by:
append
in interfacejava.lang.Appendable
- Overrides:
append
in classjava.io.Writer
- Throws:
java.io.IOException
-
flush
public void flush() throws java.io.IOException
- Specified by:
flush
in interfacejava.io.Flushable
- Specified by:
flush
in classjava.io.Writer
- Throws:
java.io.IOException
-
close
public void close() throws java.io.IOException
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Specified by:
close
in classjava.io.Writer
- Throws:
java.io.IOException
-
-