Class SystemOutputStream
public class SystemOutputStream extends FilterOutputStream
{
// Constructors
public SystemOutputStream (OutputStream out, int id);
// Methods
public void close () throws IOException;
public void write(byte b[], int off, int len) throws IOException;
}
This class provides methods that allow an application to hand an output stream to untrusted code and prevent the untrusted code from closing it. System.out and System.err objects are wrapped with this class, which extends the FilterOutputStream class.
FilterOutputStream
|
+--SystemOutputStream
public SystemOutputStream (OutputStream out, int id);
Creates a SystemOutputStream object by using the specified output stream and an identifier. The identifier will be used for security checks.
Parameter | Description |
out
| The output stream.
|
id
| The identifier for the new SystemOutputStream object.
|
public void close () throws IOException;
Closes the system output stream.
Return Value:
No return value.
Exceptions:
IOException
if an error occurs while attempting to close the output stream.
public void write(byte b[], int off, int len) throws IOException;
Writes bytes to the output stream from an array, starting at a specified offset in the array.
Return Value:
No return value.
Parameter | Description |
b
| The array to write from.
|
off
| The offset in the array, where the first byte to write is located.
|
len
| The number of bytes to write.
|
Exceptions:
IOException
if an error occurs while attempting to write to the output stream.