org.abstracthorizon.mercury.common.io
Class StringBufferReader

java.lang.Object
  extended by java.io.Reader
      extended by org.abstracthorizon.mercury.common.io.StringBufferReader
All Implemented Interfaces:
Closeable, Readable

public class StringBufferReader
extends Reader

StringBuffer reader.

Author:
Daniel Sendula

Field Summary
protected  StringBuffer buffer
          Buffer
protected  int mark
          Marker
protected  int ptr
          Pointer
protected  int size
          Size
 
Fields inherited from class java.io.Reader
lock
 
Constructor Summary
StringBufferReader(StringBuffer buffer)
          Constructor
StringBufferReader(StringBuffer buffer, int from, int size)
          Constructor
 
Method Summary
 void close()
           
 void mark()
          Marks position in string buffer
 boolean markSupported()
           
 int read(char[] cbuf, int off, int len)
           
 boolean ready()
           
 void reset()
           
 long skip(long n)
           
 
Methods inherited from class java.io.Reader
mark, read, read, read
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

buffer

protected StringBuffer buffer
Buffer


ptr

protected int ptr
Pointer


mark

protected int mark
Marker


size

protected int size
Size

Constructor Detail

StringBufferReader

public StringBufferReader(StringBuffer buffer)
Constructor

Parameters:
buffer - string buffer

StringBufferReader

public StringBufferReader(StringBuffer buffer,
                          int from,
                          int size)
Constructor

Parameters:
buffer - string buffer
from - starting offset
size - size
Method Detail

read

public int read(char[] cbuf,
                int off,
                int len)
         throws IOException
Specified by:
read in class Reader
Throws:
IOException

close

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

markSupported

public boolean markSupported()
Overrides:
markSupported in class Reader

mark

public void mark()
Marks position in string buffer


reset

public void reset()
Overrides:
reset in class Reader

ready

public boolean ready()
Overrides:
ready in class Reader

skip

public long skip(long n)
Overrides:
skip in class Reader


Copyright © 2005-2009 Abstract Horizon. All Rights Reserved.