Class DexDataWriter

  • All Implemented Interfaces:
    java.io.Closeable, java.io.Flushable, java.lang.AutoCloseable

    public class DexDataWriter
    extends java.io.BufferedOutputStream
    • Field Summary

      • Fields inherited from class java.io.BufferedOutputStream

        buf, count
      • Fields inherited from class java.io.FilterOutputStream

        out
    • Constructor Summary

      Constructors 
      Constructor Description
      DexDataWriter​(java.io.OutputStream output, int filePosition)
      Construct a new DexWriter instance that writes to output.
      DexDataWriter​(java.io.OutputStream output, int filePosition, int bufferSize)  
    • Constructor Detail

      • DexDataWriter

        public DexDataWriter​(@Nonnull
                             java.io.OutputStream output,
                             int filePosition)
        Construct a new DexWriter instance that writes to output.
        Parameters:
        output - An OutputStream to write the data to.
        filePosition - The position within the file that OutputStream will write to.
      • DexDataWriter

        public DexDataWriter​(@Nonnull
                             java.io.OutputStream output,
                             int filePosition,
                             int bufferSize)
    • Method Detail

      • write

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

        public void write​(byte[] b)
                   throws java.io.IOException
        Overrides:
        write in class java.io.FilterOutputStream
        Throws:
        java.io.IOException
      • write

        public void write​(byte[] b,
                          int off,
                          int len)
                   throws java.io.IOException
        Overrides:
        write in class java.io.BufferedOutputStream
        Throws:
        java.io.IOException
      • writeLong

        public void writeLong​(long value)
                       throws java.io.IOException
        Throws:
        java.io.IOException
      • writeInt

        public static void writeInt​(java.io.OutputStream out,
                                    int value)
                             throws java.io.IOException
        Throws:
        java.io.IOException
      • writeInt

        public void writeInt​(int value)
                      throws java.io.IOException
        Throws:
        java.io.IOException
      • writeShort

        public void writeShort​(int value)
                        throws java.io.IOException
        Throws:
        java.io.IOException
      • writeUshort

        public void writeUshort​(int value)
                         throws java.io.IOException
        Throws:
        java.io.IOException
      • writeUbyte

        public void writeUbyte​(int value)
                        throws java.io.IOException
        Throws:
        java.io.IOException
      • writeUleb128

        public static void writeUleb128​(java.io.OutputStream out,
                                        int value)
                                 throws java.io.IOException
        Throws:
        java.io.IOException
      • writeUleb128

        public void writeUleb128​(int value)
                          throws java.io.IOException
        Throws:
        java.io.IOException
      • writeSleb128

        public static void writeSleb128​(java.io.OutputStream out,
                                        int value)
                                 throws java.io.IOException
        Throws:
        java.io.IOException
      • writeSleb128

        public void writeSleb128​(int value)
                          throws java.io.IOException
        Throws:
        java.io.IOException
      • writeEncodedValueHeader

        public void writeEncodedValueHeader​(int valueType,
                                            int valueArg)
                                     throws java.io.IOException
        Throws:
        java.io.IOException
      • writeEncodedInt

        public void writeEncodedInt​(int valueType,
                                    int value)
                             throws java.io.IOException
        Throws:
        java.io.IOException
      • writeEncodedLong

        public void writeEncodedLong​(int valueType,
                                     long value)
                              throws java.io.IOException
        Throws:
        java.io.IOException
      • writeEncodedUint

        public void writeEncodedUint​(int valueType,
                                     int value)
                              throws java.io.IOException
        Throws:
        java.io.IOException
      • writeEncodedFloat

        public void writeEncodedFloat​(int valueType,
                                      float value)
                               throws java.io.IOException
        Throws:
        java.io.IOException
      • writeRightZeroExtendedInt

        protected void writeRightZeroExtendedInt​(int valueType,
                                                 int value)
                                          throws java.io.IOException
        Throws:
        java.io.IOException
      • writeEncodedDouble

        public void writeEncodedDouble​(int valueType,
                                       double value)
                                throws java.io.IOException
        Throws:
        java.io.IOException
      • writeRightZeroExtendedLong

        protected void writeRightZeroExtendedLong​(int valueType,
                                                  long value)
                                           throws java.io.IOException
        Throws:
        java.io.IOException
      • writeString

        public void writeString​(java.lang.String string)
                         throws java.io.IOException
        Throws:
        java.io.IOException
      • align

        public void align()
                   throws java.io.IOException
        Throws:
        java.io.IOException
      • getPosition

        public int getPosition()