com.sapportals.portal.prt.util
Class SmartStringWriter

java.lang.Object
  |
  +--java.io.Writer
        |
        +--com.sapportals.portal.prt.util.SmartStringWriter

public class SmartStringWriter
extends java.io.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

Version:
$Revision: #3 $
$File:$ , $Revision:$ Last modified on $Date:$ by $Author:$ using $Change:$ Copyright (c) SAP Portals Europe GmbH 2001

Field Summary
protected  RecyclableStringBuffer m_buf
           
protected  boolean m_closed
           
protected  java.lang.String m_poolName
           
 
Fields inherited from class java.io.Writer
lock
 
Constructor Summary
SmartStringWriter()
           
SmartStringWriter(int initialSize)
           
 
Method Summary
 void close()
           
 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)
           
 java.lang.String toString()
           
 void write(char[] parm1)
           
 void write(char[] cbuf, int off, int len)
           
 void write(int c)
           
 void write(java.lang.String str)
           
 void write(java.lang.String str, int off, int len)
           
 
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 java.lang.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 java.io.IOException
Overrides:
write in class java.io.Writer
Parameters:
c -  
Throws:
java.io.IOException -  

write

public void write(char[] cbuf,
                  int off,
                  int len)
           throws java.io.IOException
Overrides:
write in class java.io.Writer
Parameters:
cbuf -  
off -  
len -  
Throws:
java.io.IOException -  

write

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

write

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

write

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

flush

public void flush()
           throws java.io.IOException
Overrides:
flush in class java.io.Writer
Throws:
java.io.IOException -  

close

public void close()
           throws java.io.IOException
Overrides:
close in class java.io.Writer
Throws:
java.io.IOException -  

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getSharedString

public SharedString getSharedString()

finalize

public void finalize()
Overrides:
finalize in class java.lang.Object

realloc

public void realloc(int size)