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.WriterThis 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.Writerwriter
-
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.Writerappend(char c)java.io.Writerappend(java.lang.CharSequence csq)java.io.Writerappend(java.lang.CharSequence csq, int start, int end)voidclose()voidflush()voidwrite(char[] cbuf)voidwrite(char[] cbuf, int off, int len)voidwrite(int c)voidwrite(java.lang.String str)voidwrite(java.lang.String str, int off, int len)protected voidwriteAnnotation(AnnotationEncodedValue annotation)Write the givenAnnotationEncodedValue.protected voidwriteArray(ArrayEncodedValue array)Write the givenArrayEncodedValue.voidwriteCallSite(CallSiteReference callSiteReference)Write the givenCallSiteReference.protected voidwriteClass(java.lang.CharSequence type)voidwriteEncodedValue(EncodedValue encodedValue)Write the givenEncodedValue.voidwriteFieldDescriptor(FieldReference fieldReference)Write the field descriptor for the givenFieldReference.voidwriteMethodDescriptor(MethodReference methodReference)Write the method descriptor for the givenMethodReference.voidwriteMethodHandle(MethodHandleReference methodHandleReference)Write the givenMethodHandleReference.voidwriteMethodProtoDescriptor(MethodProtoReference protoReference)Write the method proto descriptor for the givenMethodProtoReference.voidwriteQuotedString(java.lang.CharSequence charSequence)Write the given quoted string.voidwriteReference(Reference reference)Write the givenReference.voidwriteShortFieldDescriptor(FieldReference fieldReference)Write the short field descriptor for the givenFieldReference.voidwriteShortMethodDescriptor(MethodReference methodReference)Write the short method descriptor for the givenMethodReference.protected voidwriteSimpleName(java.lang.CharSequence simpleName)Writes the given simple name.voidwriteType(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.IOExceptionWrite 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.IOExceptionWrites 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.IOExceptionWrite 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:
writein classjava.io.Writer- Throws:
java.io.IOException
-
write
public void write(char[] cbuf) throws java.io.IOException- Overrides:
writein classjava.io.Writer- Throws:
java.io.IOException
-
write
public void write(char[] cbuf, int off, int len) throws java.io.IOException- Specified by:
writein classjava.io.Writer- Throws:
java.io.IOException
-
write
public void write(java.lang.String str) throws java.io.IOException- Overrides:
writein classjava.io.Writer- Throws:
java.io.IOException
-
write
public void write(java.lang.String str, int off, int len) throws java.io.IOException- Overrides:
writein classjava.io.Writer- Throws:
java.io.IOException
-
append
public java.io.Writer append(java.lang.CharSequence csq) throws java.io.IOException- Specified by:
appendin interfacejava.lang.Appendable- Overrides:
appendin 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:
appendin interfacejava.lang.Appendable- Overrides:
appendin classjava.io.Writer- Throws:
java.io.IOException
-
append
public java.io.Writer append(char c) throws java.io.IOException- Specified by:
appendin interfacejava.lang.Appendable- Overrides:
appendin classjava.io.Writer- Throws:
java.io.IOException
-
flush
public void flush() throws java.io.IOException- Specified by:
flushin interfacejava.io.Flushable- Specified by:
flushin classjava.io.Writer- Throws:
java.io.IOException
-
close
public void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Specified by:
closein classjava.io.Writer- Throws:
java.io.IOException
-
-