All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class gnu.inet.tftp.LineBufferedOutputStream

java.lang.Object
   |
   +----java.io.OutputStream
           |
           +----java.io.FilterOutputStream
                   |
                   +----gnu.inet.tftp.LineBufferedOutputStream

public class LineBufferedOutputStream
extends FilterOutputStream
LineBufferedOutputStream A class to buffer output to a stream based on lines and a fixed buffer. This class is based on code written by the GNU Classpath project. It is taken from BufferedOutputStream.java by Aaron M. Renn (arenn@urbanophile.com) as part of the java.io package and it is licensed under GPL. Note: There is no reason it has be in this namespace but it is for convience.

Version:
0.1
Author:
Mark Benvenuto

Variable Index

 o buf
 o count

Constructor Index

 o LineBufferedOutputStream(OutputStream)
Create a new LineBufferedOutputStream
 o LineBufferedOutputStream(OutputStream, int)
Create a new LineBufferedOutputStream

Method Index

 o flush()
Flushes the buffer line by line and then does a complete flush for the remaining data
 o write(byte[], int, int)
Writes bytes buf to the internal buffer and flushes it if it is too big
 o write(int)
Writes byte b to the internal buffer and flushes it if it is too big

Variables

 o buf
 protected byte buf[]
 o count
 protected int count

Constructors

 o LineBufferedOutputStream
 public LineBufferedOutputStream(OutputStream out)
Create a new LineBufferedOutputStream

Parameters:
out - OutputStream to buffer
 o LineBufferedOutputStream
 public LineBufferedOutputStream(OutputStream out,
                                 int size)
Create a new LineBufferedOutputStream

Parameters:
out - OutputStream to buffer
size - Size of internal buffer to hold data

Methods

 o flush
 public synchronized void flush() throws IOException
Flushes the buffer line by line and then does a complete flush for the remaining data

Overrides:
flush in class FilterOutputStream
 o write
 public synchronized void write(int b) throws IOException
Writes byte b to the internal buffer and flushes it if it is too big

Parameters:
b - a byte to write
Overrides:
write in class FilterOutputStream
 o write
 public synchronized void write(byte buf[],
                                int offset,
                                int len) throws IOException
Writes bytes buf to the internal buffer and flushes it if it is too big

Parameters:
buf - bytes to write
offset - from where to start write
len - length of byte to write
Overrides:
write in class FilterOutputStream

All Packages  Class Hierarchy  This Package  Previous  Next  Index