Package edu.rit.pj.cluster
Class BackendFileOutputStream
java.lang.Object
java.io.OutputStream
edu.rit.pj.cluster.BackendFileOutputStream
- All Implemented Interfaces:
Closeable
,Flushable
,AutoCloseable
Class BackendFileOutputStream provides an object in a job backend process
that writes a sequential file in the job frontend process. A backend file
output stream is not constructed directly, rather it is created by a factory
method in class BackendFileWriter.
Note: Class BackendFileOutputStream does not do any buffering. Each method call sends a message to and receives a message from the job frontend. Consider layering a BufferedOutputStream on top of the BackendFileOutputStream.
- Version:
- 05-Nov-2006
- Author:
- Alan Kaminsky
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Close this output stream.void
flush()
Flush this output stream.void
write
(byte[] buf) Write the given byte array to this output stream.void
write
(byte[] buf, int off, int len) Write a portion of the given byte array to this output stream.void
write
(int b) Write the given byte to this output stream.Methods inherited from class java.io.OutputStream
nullOutputStream
-
Method Details
-
write
Write the given byte to this output stream. Only the least significant eight bits are written.- Specified by:
write
in classOutputStream
- Parameters:
b
- Byte.- Throws:
IOException
- Thrown if an I/O error occurred.IOException
- if any.
-
write
Write the given byte array to this output stream.- Overrides:
write
in classOutputStream
- Parameters:
buf
- Byte array.- Throws:
NullPointerException
- (unchecked exception) Thrown ifbuf
is null.IOException
- Thrown if an I/O error occurred.IOException
- if any.
-
write
Write a portion of the given byte array to this output stream.- Overrides:
write
in classOutputStream
- Throws:
NullPointerException
- (unchecked exception) Thrown ifbuf
is null.IndexOutOfBoundsException
- (unchecked exception) Thrown ifoff
< 0,len
< 0, oroff+len
>buf.length
.IOException
- Thrown if an I/O error occurred.
-
flush
Flush this output stream.- Specified by:
flush
in interfaceFlushable
- Overrides:
flush
in classOutputStream
- Throws:
IOException
- Thrown if an I/O error occurred.IOException
- if any.
-
close
Close this output stream.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classOutputStream
- Throws:
IOException
- Thrown if an I/O error occurred.IOException
- if any.
-