You are currently viewing a snapshot of www.mozilla.org taken on April 21, 2008. Most of this content is highly out of date (some pages haven't been updated since the project began in 1998) and exists for historical purposes only. If there are any pages on this archive site that you think should be added back to www.mozilla.org, please file a bug.



All Packages  This Package  Class Hierarchy  Class Search  Index

Class calypso.util.LineBufferingInputStream

java.lang.Object
   |
   +----java.io.InputStream
           |
           +----java.io.FilterInputStream
                   |
                   +----calypso.util.LineBufferingInputStream

public class  LineBufferingInputStream
     extends java.io.FilterInputStream
{
          // Fields 7
     private static final int CAPACITY;
     private static final boolean DEBUG;
     ByteBuf curline;
     boolean eof;
     ByteBuf inbuf;
     ByteLineBuffer linebuf;
     byte[] singlebyte;

          // Constructors 1
     public LineBufferingInputStream(InputStream);

          // Methods 8
     public void close() throws IOException;
     public boolean markSupported();
     public int read() throws IOException;
     public int read(byte[]) throws IOException;
     public int read(byte[], int, int) throws IOException;
     public void setInputEOL(ByteBuf);
     public void setOutputEOL(ByteBuf);
     public long skip(long);
}



Fields


DEBUG

   private static final boolean DEBUG


CAPACITY

   private static final int CAPACITY


curline

   ByteBuf curline


inbuf

   ByteBuf inbuf


linebuf

   ByteLineBuffer linebuf


eof

   boolean eof


singlebyte

   byte[] singlebyte



Constructors


LineBufferingInputStream

   public LineBufferingInputStream(InputStream s) 



Methods


read

   public int read(byte[] buf, 
                   int start, 
                   int length)  throws IOException

Reads bytes into a portion of an array. This method will block until some input is available.

The returned data will not be more than one line long: that is, there will be at most one linebreak (CR, LF, or CRLF) and if it is present, it will be at the end.

If the next line available to be read is smaller than `length', then the first `length' bytes of that line will be returned, and the remainder of the bytes on that line will be available for subsequent reads.

Returns:
the total number of bytes read into the buffer, or -1 if there is no more data because the end of the stream has been reached.
Overrides:
read in class FilterInputStream


read

   public int read(byte[] buf)  throws IOException
Overrides:
read in class FilterInputStream


read

   public int read()  throws IOException
Overrides:
read in class FilterInputStream


skip

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


markSupported

   public boolean markSupported() 
Overrides:
markSupported in class FilterInputStream


close

   public void close()  throws IOException
Overrides:
close in class FilterInputStream


setInputEOL

   public void setInputEOL(ByteBuf buf) 

Sets the EOL characters to look for in the incoming stream. Setting this to be null will cause it to look for any of , , or . Note that null (the default) could cause up to one extra to be held in the buffer (in the case where the last byte read from the underlying stream was , and no following byte (or EOF) has yet been read.)



setOutputEOL

   public void setOutputEOL(ByteBuf buf) 

End of line characters & or any combination will be replaced by this string if it is present. Setting this to a zero length string will cause them to be stripped. Setting this to null will cause the EOL characters to be passed through unchanged (the default).

Parameter Description
buf ByteBuf representing EOL replacement string



All Packages  This Package  Class Hierarchy  Class Search  Index
Freshly brewed Java API Documentation automatically generated with polardoc Version 1.0.4