|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.io.OutputStream | +--org.gnu.jcifs.CifsFileOutputStream
The class implements a CIFS 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.
The implementation was borrowed from BufferedInputStream.
Constructor Summary | |
CifsFileOutputStream(CifsDisk disk,
java.lang.String file,
boolean append)
Creates a file output stream to write to the specified file |
|
CifsFileOutputStream(CifsFile file,
boolean append)
Creates a file output stream to write to the specified file |
|
CifsFileOutputStream(java.lang.String sessionname,
java.lang.String file,
boolean append)
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. |
CifsDisk |
getDisk()
Returns the disk on which the file resides |
protected void |
open(java.lang.String file,
CifsDisk disk,
boolean append)
|
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. |
void |
write(int b)
Writes the specified byte to this buffered output stream. |
Methods inherited from class java.io.OutputStream |
write |
Methods inherited from class java.lang.Object |
|
Constructor Detail |
public CifsFileOutputStream(CifsDisk disk, java.lang.String file, boolean append) throws java.io.IOException
disk
- diskfile
- relativ to shareappend
- if true append data otherwise overwritejava.io.IOException
- if an I/O error occurs.public CifsFileOutputStream(java.lang.String sessionname, java.lang.String file, boolean append) throws java.io.IOException
sessioname
- disk session namefile
- file name( Syntax: /diskname/path
or diskname:\path
)append
- if true append data otherwise overwritejava.io.IOException
- if an I/O error occurs.public CifsFileOutputStream(CifsFile file, boolean append) throws java.io.IOException
file
- CIFS fileappend
- if true append data otherwise overwritejava.io.IOException
- if an I/O error occurs.Method Detail |
protected void open(java.lang.String file, CifsDisk disk, boolean append) throws java.io.IOException
public CifsDisk getDisk() throws java.io.IOException
java.io.IOException
- if file is closedpublic void write(int b) throws java.io.IOException
write
in class java.io.OutputStream
b
- the byte to be written.java.io.IOException
- if an I/O error occurs.public void write(byte[] b, int off, int len) throws java.io.IOException
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.
write
in class java.io.OutputStream
b
- the data.off
- the start offset in the data.len
- the number of bytes to write.java.io.IOException
- if an I/O error occurs.public void flush() throws java.io.IOException
flush
in class java.io.OutputStream
java.io.IOException
- if an I/O error occurs.public void close() throws java.io.IOException
close
in class java.io.OutputStream
public void finalize()
finalize
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |