|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.foxsmart.ic.io.StreamWriter
public class StreamWriter
This class provides the ability to write a stream of bytes to a specified destination (e.g. a file on a hard disk). The stream can be written in increments in case the stream is being written over a long period of time and the caller wishes to provide some type of user feedback during the writing process.
| Constructor Summary | |
|---|---|
StreamWriter(java.io.File file)
Constructs a stream writer to a file. |
|
| Method Summary | |
|---|---|
void |
close()
Closes the output stream. |
static void |
main(java.lang.String[] args)
Test Driver. |
int |
write(byte[] byteArray)
Write all bytes in a byte array to the output stream. |
int |
write(byte[] byteArray,
int offset,
int length)
Write a specified number of bytes in a byte array to the output stream. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public StreamWriter(java.io.File file)
throws java.io.IOException
file - The file to create the stream to
java.io.IOException - if the URL stream could not be opened to the URL| Method Detail |
|---|
public int write(byte[] byteArray)
throws java.io.IOException
byteArray - The byte array to write.
java.io.IOException - if the stream could not be written or an error occurred while writing to the stream.
public int write(byte[] byteArray,
int offset,
int length)
throws java.io.IOException
byteArray - The byte array to write.offset - The offset in the array to start writing.length - The number of bytes to write.
java.io.IOException - if the stream could not be written or an error occurred while writing to the stream.
public void close()
throws java.io.IOException
java.io.IOException - if the stream could not be closed.public static void main(java.lang.String[] args)
args - the arguments
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||