org.testng.reporters
Class FileStringBuffer

java.lang.Object
  extended by org.testng.reporters.FileStringBuffer
All Implemented Interfaces:
IBuffer

public class FileStringBuffer
extends Object
implements IBuffer

A string buffer that flushes its content to a temporary file whenever the internal string buffer becomes larger than MAX. If the buffer never reaches that size, no file is ever created and everything happens in memory, so the overhead compared to StringBuffer/StringBuilder is minimal. Note: calling toString() will force the entire string to be loaded in memory, use toWriter() if you need to avoid this. This class is not multi thread safe.

Since:
Nov 9, 2012
Author:
Cedric Beust

Constructor Summary
FileStringBuffer()
           
FileStringBuffer(int maxCharacters)
           
 
Method Summary
 FileStringBuffer append(CharSequence s)
           
static void main(String[] args)
           
 String toString()
           
 void toWriter(Writer fw)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FileStringBuffer

public FileStringBuffer()

FileStringBuffer

public FileStringBuffer(int maxCharacters)
Method Detail

append

public FileStringBuffer append(CharSequence s)
Specified by:
append in interface IBuffer

toWriter

public void toWriter(Writer fw)
Specified by:
toWriter in interface IBuffer

toString

public String toString()
Overrides:
toString in class Object

main

public static void main(String[] args)
                 throws IOException
Throws:
IOException


Copyright © 2015. All Rights Reserved.