|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.io.OutputStream | +--com.starla.smb.SMBOutputStream
SMB output stream class.
The SMBOutputStream class provides a standard OutputStream interface to an existing remote file, or can be used to create a new remote file.
The class may be used with other I/O stream classes such as PrintWriter, DataOutputStream etc.
Note: It is not necessary to use a BufferedOutputStream or BufferedWriter class with the SMBOutputStream as the underlying network connection will usually buffer 4Kb of data, up to a maximum of 64Kb.
Example use of the SMBOutputStream class
PCShare shr = new PCShare ( "\\\\TEST\\C\\");
SMBDiskSession sess = SMBSessionFactory.OpenDisk ( shr);
SMBOutputStream out = sess.OpenOutputStream ( "DATAFILE.OUT", SMBAccessMode.WriteOnly);
PrintWriter pWrt = new PrintWriter ( out, false);
for ( int i = 0; i < 20; i++)
pWrt.println ( "Record " + i);
pWrt.flush ();
out.close ();
Method Summary | |
void |
close()
Close this output stream and release any system resources associated with the stream. |
SMBFile |
File()
Return a reference to the associated SMBFile object. |
void |
flush()
Flush this output stream, force any buffered data to be written out. |
void |
write(byte[] buf,
int off,
int len)
Write the specified byte array to the output stream, starting at the specified offset within the byte array. |
void |
write(int byt)
Write the specified byte to this output stream. |
Methods inherited from class java.io.OutputStream |
write |
Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Method Detail |
public void close() throws java.io.IOException
public final SMBFile File()
public void flush() throws java.io.IOException
public void write(byte[] buf, int off, int len) throws java.io.IOException
buf
- Byte array containing the data to be output.off
- Offset within the buffer that the data starts.len
- Length of the data to be output.public void write(int byt) throws java.io.IOException
byt
- Byte to be output to this stream.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |