Class 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 Detail

      • writer

        protected final java.io.Writer writer
    • Constructor Detail

      • DexFormattedWriter

        public DexFormattedWriter​(java.io.Writer writer)
    • Method Detail

      • writeMethodDescriptor

        public void writeMethodDescriptor​(MethodReference methodReference)
                                   throws java.io.IOException
        Write the method descriptor for the given MethodReference.
        Throws:
        java.io.IOException
      • writeShortMethodDescriptor

        public void writeShortMethodDescriptor​(MethodReference methodReference)
                                        throws java.io.IOException
        Write the short method descriptor for the given MethodReference.

        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 given MethodProtoReference.
        Throws:
        java.io.IOException
      • writeFieldDescriptor

        public void writeFieldDescriptor​(FieldReference fieldReference)
                                  throws java.io.IOException
        Write the field descriptor for the given FieldReference.
        Throws:
        java.io.IOException
      • writeShortFieldDescriptor

        public void writeShortFieldDescriptor​(FieldReference fieldReference)
                                       throws java.io.IOException
        Write the short field descriptor for the given FieldReference.

        The short field descriptor typically elides the class that the field is a member of.

        Throws:
        java.io.IOException
      • writeCallSite

        public void writeCallSite​(CallSiteReference callSiteReference)
                           throws java.io.IOException
        Write the given CallSiteReference.
        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 given EncodedValue.
        Throws:
        java.io.IOException
      • writeReference

        public void writeReference​(Reference reference)
                            throws java.io.IOException
        Write the given Reference.
        Throws:
        java.io.IOException
      • write

        public void write​(int c)
                   throws java.io.IOException
        Overrides:
        write in class java.io.Writer
        Throws:
        java.io.IOException
      • write

        public void write​(char[] cbuf)
                   throws java.io.IOException
        Overrides:
        write in class java.io.Writer
        Throws:
        java.io.IOException
      • write

        public void write​(char[] cbuf,
                          int off,
                          int len)
                   throws java.io.IOException
        Specified by:
        write in class java.io.Writer
        Throws:
        java.io.IOException
      • write

        public void write​(java.lang.String str)
                   throws java.io.IOException
        Overrides:
        write in class java.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 class java.io.Writer
        Throws:
        java.io.IOException
      • append

        public java.io.Writer append​(java.lang.CharSequence csq)
                              throws java.io.IOException
        Specified by:
        append in interface java.lang.Appendable
        Overrides:
        append in class java.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 interface java.lang.Appendable
        Overrides:
        append in class java.io.Writer
        Throws:
        java.io.IOException
      • append

        public java.io.Writer append​(char c)
                              throws java.io.IOException
        Specified by:
        append in interface java.lang.Appendable
        Overrides:
        append in class java.io.Writer
        Throws:
        java.io.IOException
      • flush

        public void flush()
                   throws java.io.IOException
        Specified by:
        flush in interface java.io.Flushable
        Specified by:
        flush in class java.io.Writer
        Throws:
        java.io.IOException
      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Specified by:
        close in class java.io.Writer
        Throws:
        java.io.IOException