com.github.libxjava.io
Class BufferedOutputStream

java.lang.Object
  extended by java.io.OutputStream
      extended by com.github.libxjava.io.BufferedOutputStream

public abstract class BufferedOutputStream
extends OutputStream

Version:
libxjava-cldc - 0.3
Author:
Marcel Patzlaff

Field Summary
protected  int bufsize
           
protected  Object worklock
           
 
Constructor Summary
protected BufferedOutputStream(int bufsize)
           
 
Method Summary
 void clear()
           
 void close()
           
 void flush()
           
protected  int getPayloadEnd()
           
protected  int getPayloadStart()
           
protected abstract  void internalWrite(byte[] buffer, int end, boolean flushed)
          end indicates the length of the payload and the first non-payload bytes.
 void write(byte[] b, int off, int len)
           
 void write(int b)
           
 
Methods inherited from class java.io.OutputStream
write
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

bufsize

protected final int bufsize

worklock

protected final Object worklock
Constructor Detail

BufferedOutputStream

protected BufferedOutputStream(int bufsize)
Method Detail

close

public void close()
           throws IOException
Overrides:
close in class OutputStream
Throws:
IOException

clear

public final void clear()

flush

public final void flush()
                 throws IOException
Overrides:
flush in class OutputStream
Throws:
IOException

write

public final void write(byte[] b,
                        int off,
                        int len)
                 throws IOException
Overrides:
write in class OutputStream
Throws:
IOException

write

public final void write(int b)
                 throws IOException
Specified by:
write in class OutputStream
Throws:
IOException

getPayloadStart

protected int getPayloadStart()

getPayloadEnd

protected int getPayloadEnd()

internalWrite

protected abstract void internalWrite(byte[] buffer,
                                      int end,
                                      boolean flushed)
                               throws IOException
end indicates the length of the payload and the first non-payload bytes.

Throws:
IOException


Copyright © 2011 Marcel Patzlaff. All Rights Reserved.