Class IndentingWriter

java.lang.Object
java.io.Writer
java.io.FilterWriter
com.android.dx.util.IndentingWriter
All Implemented Interfaces:
Closeable, Flushable, Appendable, AutoCloseable

public final class IndentingWriter extends FilterWriter
Writer that wraps another writer and passes width-limited and optionally-prefixed output to its subordinate. When lines are wrapped they are automatically indented based on the start of the line.
  • Constructor Details

    • IndentingWriter

      public IndentingWriter(Writer out, int width, String prefix)
      Constructs an instance.
      Parameters:
      out - non-null; writer to send final output to
      width - >= 0; the maximum output width (not including prefix), or 0 for no maximum
      prefix - non-null; the prefix for each line
    • IndentingWriter

      public IndentingWriter(Writer out, int width)
      Constructs a no-prefix instance.
      Parameters:
      out - non-null; writer to send final output to
      width - >= 0; the maximum output width (not including prefix), or 0 for no maximum
  • Method Details