This is a simple class that provides a string full of spaces. This may be used to avoid memory allocations/initializations.
Public Static Methods | |
static AString | get () |
static AString | get (int minSize) |
static void | write (PrintStream os, int qty) |
static void | write (Writer os, int qty) |
Private Static Fields | |
static byte[] | spacesByte |
static AString | theSpaces =new AString() |
|
static |
|
static |
Receives an AString full of spaces. The AString returned must not be altered.
minSize | The minimum number of spaces that should be available in the returned AString. Defaults to 128. See notes in method description! |
|
static |
Write the given number of spaces to a PrintStream.
os | The output stream to write to |
qty | The quantity of spaces to write |
|
static |
Write the given number of spaces to a Writer.
os | The output stream to write to |
qty | The quantity of spaces to write |
|
staticprivate |
A fixed size byte array of spaces used in write(PrintStream, int). Unfortunately, Java does not provide a method in PrintStream to write a portion of a character array, therefore this is fixed (and redundant to field theSpaces).