Class DexDataWriter

All Implemented Interfaces:
Closeable, Flushable, AutoCloseable

public class DexDataWriter extends BufferedOutputStream
  • Field Details

    • filePosition

      private int filePosition
      The position within the file that we will write to next. This is only updated when the buffer is flushed to the outputStream.
    • tempBuf

      private byte[] tempBuf
      A temporary buffer that can be used for larger writes. Can be replaced with a larger buffer if needed. Must be at least 8 bytes
    • zeroBuf

      private byte[] zeroBuf
      A buffer of 0s to use for writing alignment values
  • Constructor Details

    • DexDataWriter

      public DexDataWriter(@Nonnull 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 OutputStream output, int filePosition, int bufferSize)
  • Method Details