org.gnu.jcifs
Class CifsPrintOutputStream

java.lang.Object
  |
  +--java.io.OutputStream
        |
        +--org.gnu.jcifs.CifsPrintOutputStream

public class CifsPrintOutputStream
extends java.io.OutputStream

The class implements a CIFS print output stream. The data is written into a buffer, and then written to the underlying stream if the buffer reaches its capacity, the buffer output stream is closed, or the buffer output stream is explicity flushed. The default buffer size is 2048. The system property org.gnu.jcifs.io.bufsize specifies the buffer size.

Since:
1.0

Field Summary
(package private)  int fFID
           
(package private)  PrinterImpl fPrinter
           
 
Constructor Summary
(package private) CifsPrintOutputStream(CifsPrinter printer, java.lang.String printid, int fid)
          Creates a file output stream to write to the specified file
 
Method Summary
 void close()
          Closes this output stream and releases any system resources associated with the stream.
 void finalize()
           
 void flush()
          Flushes this buffered output stream.
 void write(byte[] b, int off, int len)
          Writes len bytes from the specified byte array starting at offset off to this buffered output stream.
 long write(java.io.InputStream in)
           
 void write(int b)
          Writes the specified byte to this buffered output stream.
 long write(java.io.Reader in)
           
 
Methods inherited from class java.io.OutputStream
write
 
Methods inherited from class java.lang.Object
, clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fFID

int fFID

fPrinter

PrinterImpl fPrinter
Constructor Detail

CifsPrintOutputStream

CifsPrintOutputStream(CifsPrinter printer,
                      java.lang.String printid,
                      int fid)
                throws java.io.IOException
Creates a file output stream to write to the specified file
Parameters:
disk - disk
file - relativ to share
append - if true append data otherwise overwrite
Throws:
java.io.IOException - if an I/O error occurs.
Method Detail

write

public void write(int b)
           throws java.io.IOException
Writes the specified byte to this buffered output stream.
Overrides:
write in class java.io.OutputStream
Parameters:
b - the byte to be written.
Throws:
java.io.IOException - if an I/O error occurs.

write

public void write(byte[] b,
                  int off,
                  int len)
           throws java.io.IOException
Writes len bytes from the specified byte array starting at offset off to this buffered output stream.

Ordinarily this method stores bytes from the given array into this stream's buffer, flushing the buffer to the underlying output stream as needed. If the requested length is at least as large as this stream's buffer, however, then this method will flush the buffer and write the bytes directly to the underlying output stream.

Overrides:
write in class java.io.OutputStream
Parameters:
b - the data.
off - the start offset in the data.
len - the number of bytes to write.
Throws:
java.io.IOException - if an I/O error occurs.

write

public long write(java.io.InputStream in)
           throws java.io.IOException

write

public long write(java.io.Reader in)
           throws java.io.IOException

flush

public void flush()
           throws java.io.IOException
Flushes this buffered output stream. This forces any buffered output bytes to be written out to the underlying output stream.
Overrides:
flush in class java.io.OutputStream
Throws:
java.io.IOException - if an I/O error occurs.

close

public void close()
           throws java.io.IOException
Closes this output stream and releases any system resources associated with the stream.
Overrides:
close in class java.io.OutputStream

finalize

public void finalize()
Overrides:
finalize in class java.lang.Object