jist.swans.app.io
Class BufferedInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by jist.swans.app.io.InputStream
          extended by jist.swans.app.io.FilterInputStream
              extended by jist.swans.app.io.BufferedInputStream
All Implemented Interfaces:
java.io.Closeable

public class BufferedInputStream
extends FilterInputStream

A functionally identical port of java.io.BufferedInputStream, primarily brought into jist.swans.app.io package so that it could be dynamically rewritten.

Since:
SWANS1.0
Version:
$Id: BufferedInputStream.java,v 1.3 2004/04/06 16:07:46 barr Exp $
Author:
Sun Microsystems, Rimon Barr <barr+jist@cs.cornell.edu>

Field Summary
protected  byte[] buf
           
protected  int count
           
private static int defaultBufferSize
           
protected  int marklimit
           
protected  int markpos
           
protected  int pos
           
 
Fields inherited from class jist.swans.app.io.FilterInputStream
in
 
Constructor Summary
BufferedInputStream(InputStream in)
           
BufferedInputStream(InputStream in, int size)
           
 
Method Summary
 int available()
           
 void close()
           
private  void ensureOpen()
           
private  void fill()
           
 void mark(int readlimit)
           
 boolean markSupported()
           
 int read()
           
 int read(byte[] b, int off, int len)
           
private  int read1(byte[] b, int off, int len)
           
 void reset()
           
 long skip(long n)
           
 
Methods inherited from class jist.swans.app.io.FilterInputStream
read
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

defaultBufferSize

private static int defaultBufferSize
See Also:
BufferedInputStream

buf

protected byte[] buf
See Also:
BufferedInputStream

count

protected int count
See Also:
BufferedInputStream

pos

protected int pos
See Also:
BufferedInputStream

markpos

protected int markpos
See Also:
BufferedInputStream

marklimit

protected int marklimit
See Also:
BufferedInputStream
Constructor Detail

BufferedInputStream

public BufferedInputStream(InputStream in)
See Also:
BufferedInputStream

BufferedInputStream

public BufferedInputStream(InputStream in,
                           int size)
See Also:
BufferedInputStream
Method Detail

ensureOpen

private void ensureOpen()
                 throws java.io.IOException
Throws:
java.io.IOException
See Also:
BufferedInputStream

fill

private void fill()
           throws java.io.IOException
Throws:
java.io.IOException
See Also:
BufferedInputStream

read

public int read()
         throws java.io.IOException,
                JistAPI.Continuation
Overrides:
read in class FilterInputStream
Throws:
java.io.IOException
JistAPI.Continuation
See Also:
BufferedInputStream

read1

private int read1(byte[] b,
                  int off,
                  int len)
           throws java.io.IOException
Throws:
java.io.IOException
See Also:
BufferedInputStream

read

public int read(byte[] b,
                int off,
                int len)
         throws java.io.IOException,
                JistAPI.Continuation
Overrides:
read in class FilterInputStream
Throws:
java.io.IOException
JistAPI.Continuation
See Also:
BufferedInputStream

skip

public long skip(long n)
          throws java.io.IOException,
                 JistAPI.Continuation
Overrides:
skip in class FilterInputStream
Throws:
java.io.IOException
JistAPI.Continuation
See Also:
BufferedInputStream

available

public int available()
              throws java.io.IOException,
                     JistAPI.Continuation
Overrides:
available in class FilterInputStream
Throws:
java.io.IOException
JistAPI.Continuation
See Also:
BufferedInputStream

mark

public void mark(int readlimit)
          throws JistAPI.Continuation
Overrides:
mark in class FilterInputStream
Throws:
JistAPI.Continuation
See Also:
BufferedInputStream

reset

public void reset()
           throws java.io.IOException,
                  JistAPI.Continuation
Overrides:
reset in class FilterInputStream
Throws:
java.io.IOException
JistAPI.Continuation
See Also:
BufferedInputStream

markSupported

public boolean markSupported()
                      throws JistAPI.Continuation
Overrides:
markSupported in class FilterInputStream
Throws:
JistAPI.Continuation
See Also:
BufferedInputStream

close

public void close()
           throws java.io.IOException,
                  JistAPI.Continuation
Specified by:
close in interface java.io.Closeable
Overrides:
close in class FilterInputStream
Throws:
java.io.IOException
JistAPI.Continuation
See Also:
BufferedInputStream