All Packages Class Hierarchy This Package Previous Next Index
Class com.starla.lite.SMBOutputStream
java.lang.Object
|
+----java.io.OutputStream
|
+----com.starla.lite.SMBOutputStream
- public class SMBOutputStream
- extends OutputStream
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 ();
- Version:
- 1.0
-
close()
- Close this output stream and release any system resources associated with
the stream.
-
File()
- Return a reference to the associated SMBFile object.
-
flush()
- Flush this output stream, force any buffered data to be written out.
-
write(byte[], int, int)
- Write the specified byte array to the output stream, starting at the specified
offset within the byte array.
-
write(int)
- Write the specified byte to this output stream.
close
public void close() throws IOException
- Close this output stream and release any system resources associated with
the stream.
- Throws: IOException
- If an I/O error occurs.
- Overrides:
- close in class OutputStream
File
public final SMBFile File()
- Return a reference to the associated SMBFile object.
- Returns:
- SMBFile associated with this output stream.
flush
public void flush() throws IOException
- Flush this output stream, force any buffered data to be written out.
- Throws: IOException
- If an I/O error occurs.
- Overrides:
- flush in class OutputStream
write
public void write(byte buf[],
int off,
int len) throws IOException
- Write the specified byte array to the output stream, starting at the specified
offset within the byte array.
- Parameters:
- 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.
- Throws: IOException
- If an I/O error occurs.
- Overrides:
- write in class OutputStream
write
public void write(int byt) throws IOException
- Write the specified byte to this output stream.
- Parameters:
- byt - Byte to be output to this stream.
- Throws: IOException
- If an I/O error occurs.
- Overrides:
- write in class OutputStream
All Packages Class Hierarchy This Package Previous Next Index