FileDocCategorySizeDatePackage
Output.javaAPI DocAndroid 1.5 API2238Wed May 06 22:41:10 BST 2009com.android.mkstubs.sourcer

Output

public class Output extends Object
An {@link Output} objects is an helper to write to a character stream {@link Writer}.

It provide some helper methods to the various "sourcer" classes from this package to help them write to the underlying stream.

Fields Summary
private final Writer
mWriter
Constructors Summary
public Output(Writer writer)
Creates a new {@link Output} object that wraps the given {@link Writer}.

The caller is responsible of opening and closing the {@link Writer}.

param
writer The writer to write to. Could be a file, a string, etc.

        mWriter = writer;
    
Methods Summary
public voidwrite(java.lang.String format, java.lang.Object args)
Writes a formatted string to the writer.

param
format The format string.
param
args The arguments for the format string.
see
String#format(String, Object...)

        try {
            mWriter.write(String.format(format, args));
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    
public voidwrite(char c)
Writes a single character to the writer.

param
c The character to write.

        write(Character.toString(c));
    
public voidwrite(java.lang.StringBuilder sb)
Writes a {@link StringBuilder} to the writer.

param
sb The {@link StringBuilder#toString()} method is used to ge the string to write.

        write(sb.toString());