|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.io.OutputStream | +--com.novell.java.io.NOutputStream
Provides output stream functionality to various data device objects, which implements the DataAccessable interface.
The various constructors open an output stream on (or with) the DataAccessable object passed into the constructors. The DataAccessable object might have container capabilities and support subordinate streams, or it may only support a stream to itself. The constructors with a name parameter (which must be atomic) attempt to open a subordinate stream through the given DataAccessable object. The constructors without a name parameter attempt to open a stream on the given DataAcessable object.
There is also a set of constructors that support provider based custom parameters. A given implementation of a DataAccessable object might require custom parameters to open the stream. For example, a file system provider might require open flags, fork selectors, name space information, size, and so forth, to open the stream. The custom Object parameter allows for passing known provider-supplied objects to their DataAccessable implementations, allowing the user full control over the opening of the stream if needed. The various providers must implement reasonable defaults for any custom parameters if the non-custom constructors are used (open flags == WRITE). See Novell's DataAccessableParameters and NFileOutputStream for an example of how a provider might implement this support.
NoSubordinateAccessException will be thrown if the given DataAccessable object does not support subordinate streams (subordinate constructors). SubordinateAccessOnlyException will be thrown if the given DataAccessable object does not support a stream on itself.
DataAccessable
,
NInputStream
,
RandomAccess
,
NFileOutputStream
,
DataAccessableParameters
Constructor Summary | |
NOutputStream(DataAccessable accessor)
Creates an instance of the NOutputStream object. |
|
NOutputStream(DataAccessable accessor,
java.lang.Object custom)
Creates an instance of the NOutputStream object with the custom parameter to the accessor. |
|
NOutputStream(java.lang.String name,
DataAccessable accessor)
Creates a subordinate instance of the NOutputStream. |
|
NOutputStream(java.lang.String name,
DataAccessable accessor,
java.lang.Object custom)
Creates a subordinate instance of an NOutputStream with the custom parameter. |
Method Summary | |
void |
close()
Closes the stream. |
void |
flush()
Makes sure that all output is written. |
void |
write(byte[] b)
Writes an array of bytes. |
void |
write(byte[] b,
int off,
int len)
Writes a subset of an array of bytes. |
void |
write(int b)
Writes one byte. |
Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public NOutputStream(DataAccessable accessor) throws java.io.IOException
Opens an output stream to the DataAccessable accessor parameter.
accessor
- The DataAccessable object to use.public NOutputStream(DataAccessable accessor, java.lang.Object custom) throws java.io.IOException
Opens an output stream to the DataAccessable accessor parameter, passing the provider-based custom parameter to the accessor for the open.
accessor
- The DataAccessable object to use.custom
- The provider-specific custom object containing
any needed parameters to open the stream.public NOutputStream(java.lang.String name, DataAccessable accessor) throws java.io.IOException
Opens a subordinate output stream to the DataAccessable accessor parameter.
name
- The atomic subordinate stream name to open.accessor
- The DataAccessable object to use.public NOutputStream(java.lang.String name, DataAccessable accessor, java.lang.Object custom) throws java.io.IOException
Opens a subordinate output stream to the DataAccessable accessor parameter, passing the provider based custom parameter to the accessor for the open.
name
- The atomic subordinate stream name to open.accessor
- The DataAccessable object to use.custom
- The Provider specific custom object containing
any needed parameters to open the stream.Method Detail |
public void close() throws java.io.IOException
public void flush() throws java.io.IOException
public void write(int b) throws java.io.IOException
b
- The byte to write.public void write(byte[] b) throws java.io.IOException
All bytes in the array are written.
b
- The array of bytes to write.public void write(byte[] b, int off, int len) throws java.io.IOException
b
- The array of bytes to write.off
- The offset from which to start writing.len
- The number of bytes to write.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |