Class java.io.StringBufferInputStream
All Packages  Class Hierarchy  This Package  Previous  Next  Index
  Class java.io.StringBufferInputStream
java.lang.Object
   |
   +----java.io.InputStream
           |
           +----java.io.StringBufferInputStream
  -  public class StringBufferInputStream
  -  extends InputStream
This class implements a String buffer that can be
used as an InputStream.
   
  -   buffer buffer
-  The buffer where data is stored.
  
-   count count
-  The number of characters to use in the buffer.
  
-   pos pos
-  The position in the buffer.
   
  -   StringBufferInputStream(String) StringBufferInputStream(String)
-  Creates an StringBufferInputStream from the specified array of 
bytes.
   
  -   available() available()
-  Returns the number of available bytes in the buffer.
  
-   read() read()
-  Reads a byte of data.
  
-   read(byte[], int, int) read(byte[], int, int)
-  Reads into an array of bytes.
  
-   reset() reset()
-  Resets the buffer to the beginning.
  
-   skip(long) skip(long)
-  Skips n bytes of input.
   
 buffer
buffer
  protected String buffer
  -  The buffer where data is stored.
 pos
pos
  protected int pos
  -  The position in the buffer.
 count
count
  protected int count
  -  The number of characters to use in the buffer.
   
 StringBufferInputStream
StringBufferInputStream
  public StringBufferInputStream(String s)
  -  Creates an StringBufferInputStream from the specified array of 
bytes.
  
    -  Parameters:
    
-  s - the input buffer (not copied)
  
 
   
 read
read
  public synchronized int read()
  -  Reads a byte of data.
  
    -  Returns:
    
-  the byte read, or -1 if the end of the
stream is reached.
    
-  Overrides:
    
-  read in class InputStream
  
 
 read
read
  public synchronized int read(byte b[],
                               int off,
                               int len)
  -  Reads into an array of bytes.
  
    -  Parameters:
    
-  b - the buffer into which the data is read
    -  off - the start offset of the data
    -  len - the maximum number of bytes read
    
-  Returns:
    
-  the actual number of bytes read; -1 is
returned when the end of the stream is reached.
    
-  Overrides:
    
-  read in class InputStream
  
 
 skip
skip
  public synchronized long skip(long n)
  -  Skips n bytes of input.
  
    -  Parameters:
    
-  n - the number of bytes to be skipped
    
-  Returns:
    
-  the actual number of bytes skipped.
    
-  Overrides:
    
-  skip in class InputStream
  
 
 available
available
  public synchronized int available()
  -  Returns the number of available bytes in the buffer.
  
    -  Overrides:
    
-  available in class InputStream
  
 
 reset
reset
  public synchronized void reset()
  -  Resets the buffer to the beginning.
  
    -  Overrides:
    
-  reset in class InputStream
  
 
All Packages  Class Hierarchy  This Package  Previous  Next  Index