com.dynalivery.dor
Class StringToXMLHelper
java.lang.Object
|
+--com.dynalivery.dor.StringToXMLHelper
- public class StringToXMLHelper
- extends java.lang.Object
This helper class is designed to allow many short strings to be streamed to an output stream
with UTF8 encoding while bounding the memory use and reducing object creation to help performance.
It accomplishes this by appending String's to a StringBuffer which is only allowed to grow to
a maximum size before the conversion to UTF8 occurs and the byte array written to the OutputStream.
The StringBuffer is used because a call to convert a String to a byte array results in object creation
every time.
|
Constructor Summary |
StringToXMLHelper(java.io.OutputStream outStream,
int maxBufferSize)
Creates new StringToXMLHelper |
| Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
StringToXMLHelper
public StringToXMLHelper(java.io.OutputStream outStream,
int maxBufferSize)
- Creates new StringToXMLHelper
append
public StringToXMLHelper append(java.lang.String string)
throws java.io.IOException
append
public StringToXMLHelper append(double value)
throws java.io.IOException
append
public StringToXMLHelper append(int value)
throws java.io.IOException
append
public StringToXMLHelper append(byte value)
throws java.io.IOException
append
public StringToXMLHelper append(short value)
throws java.io.IOException
close
public void close()
throws java.io.IOException