com.sapportals.portal.prt.util

Class SmartStringWriter

java.lang.Object
  extended by java.io.Writer
      extended by com.sapportals.portal.prt.util.SmartStringWriter
All Implemented Interfaces:
Closeable, Flushable, Appendable

public class SmartStringWriter
extends Writer

This StrinWriter uses an underlying pooled StringBuffer
Calling close() method causes the buffer to be released and is able to be reused. Created: Wed Jun 27 15:09:47 2001


Field Summary
protected  RecyclableStringBuffer m_buf
           
protected  boolean m_closed
           
protected  String m_poolName
           
 
Fields inherited from class java.io.Writer
lock
 
Constructor Summary
SmartStringWriter()
           
SmartStringWriter(int initialSize)
           
 
Method Summary
 void close()
           
protected  void finalize()
           
 void flush()
           
 SharedString getSharedString()
           
protected  StringBufferPool getStringBufferPool()
          This method can be overridden by subclasses to use a specific pool of StringBuffers.
protected  void initBuffer(int initialSize)
          This method can be overridden by subclasses
 void realloc(int size)
           
 String toString()
           
 void write(char[] parm1)
           
 void write(char[] cbuf, int off, int len)
           
 void write(int c)
          Write a single character.
 void write(String str)
           
 void write(String str, int off, int len)
           
 
Methods inherited from class java.io.Writer
append, append, append
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

m_buf

protected RecyclableStringBuffer m_buf

m_closed

protected boolean m_closed

m_poolName

protected String m_poolName
Constructor Detail

SmartStringWriter

public SmartStringWriter()

SmartStringWriter

public SmartStringWriter(int initialSize)
Parameters:
initialSize -
Method Detail

initBuffer

protected void initBuffer(int initialSize)
This method can be overridden by subclasses


getStringBufferPool

protected StringBufferPool getStringBufferPool()
This method can be overridden by subclasses to use a specific pool of StringBuffers. The default implementation returns the default pool.


write

public void write(int c)
           throws IOException
Write a single character. The character to be written is contained in the 16 low-order bits of the given integer value; the 16 high-order bits are ignored.

Overrides:
write in class Writer
Parameters:
c -
Throws:
IOException

write

public void write(char[] cbuf,
                  int off,
                  int len)
           throws IOException
Specified by:
write in class Writer
Parameters:
cbuf -
off -
len -
Throws:
IOException

write

public void write(char[] parm1)
           throws IOException
Overrides:
write in class Writer
Parameters:
parm1 -
Throws:
IOException

write

public void write(String str,
                  int off,
                  int len)
           throws IOException
Overrides:
write in class Writer
Parameters:
str -
off -
len -
Throws:
IOException

write

public void write(String str)
           throws IOException
Overrides:
write in class Writer
Parameters:
str -
Throws:
IOException

flush

public void flush()
           throws IOException
Specified by:
flush in interface Flushable
Specified by:
flush in class Writer
Throws:
IOException

close

public void close()
           throws IOException
Specified by:
close in interface Closeable
Specified by:
close in class Writer
Throws:
IOException

toString

public String toString()
Overrides:
toString in class Object

getSharedString

public SharedString getSharedString()

finalize

protected void finalize()
                 throws Throwable
Overrides:
finalize in class Object
Throws:
Throwable

realloc

public void realloc(int size)
Access Rights

This class can be accessed from:


SC DC Public Part ACH
[sap.com] EP-BASIS-API [sap.com] epbc.prtapi._apideprecated default EP-PIN-PRT
[sap.com] EP-BASIS-API [sap.com] tc/epbc/prt/api api EP-PIN


Copyright 2011 SAP AG Complete Copyright Notice