Package robocode

# Class RobocodeFileOutputStream

java.lang.Object
java.io.OutputStream
robocode.RobocodeFileOutputStream

All Implemented Interfaces:
  `Closeable`, `Flushable`, `AutoCloseable`

public class RobocodeFileOutputStream extends OutputStream
RobocodeFileOutputStream is similar to a `FileOutputStream` and is used for streaming/writing data out to a file, which you got previously by calling `getDataFile()`.

You should read `FileOutputStream` for documentation of this class.

Please notice that the max. size of your data file is set to 200000 (~195 KB).

Author:
  Mathew A. Nelson (original), Flemming N. Larsen (contributor)
See Also:
  - `AdvancedRobot.getDataFile(String)`
  - `FileOutputStream`

## Constructor Summary

Constructors
Constructor
Description
`RobocodeFileOutputStream(File file)`
Constructs a new RobocodeFileOutputStream.
`RobocodeFileOutputStream(FileDescriptor fdObj)`
Constructs a new RobocodeFileOutputStream.
`RobocodeFileOutputStream(String fileName)`
Constructs a new RobocodeFileOutputStream.
`RobocodeFileOutputStream(String fileName, boolean append)`
Constructs a new RobocodeFileOutputStream.

## Method Summary

Modifier and Type
Method
Description
`final void`
`close()`
Closes this output stream.
`final void`
`flush()`
Flushes this output stream.
`final String`
`getName()`
Returns the filename of this output stream.
`final void`
`write(byte[] b)`
Writes a byte array to this output stream.
`final void`
`write(byte[] b, int off, int len)`
Writes a byte array to this output stream.
`final void`
`write(int b)`
Writes a single byte to this output stream.

### Methods inherited from class java.io.OutputStream

`nullOutputStream`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### RobocodeFileOutputStream

public RobocodeFileOutputStream(File file) throws IOException
Constructs a new RobocodeFileOutputStream. See `FileOutputStream(File)` for documentation about this constructor.

Throws:
  `IOException`
See Also:
  - `FileOutputStream(File)`

### RobocodeFileOutputStream

public RobocodeFileOutputStream(FileDescriptor fdObj)
Constructs a new RobocodeFileOutputStream. See `FileOutputStream(FileDescriptor)` for documentation about this constructor.

See Also:
  - `FileOutputStream(FileDescriptor)`

### RobocodeFileOutputStream

public RobocodeFileOutputStream(String fileName) throws IOException
Constructs a new RobocodeFileOutputStream. See `FileOutputStream(String)` for documentation about this constructor.

Throws:
  `IOException`
See Also:
  - `FileOutputStream(String)`

### RobocodeFileOutputStream

public RobocodeFileOutputStream(String fileName, boolean append) throws IOException
Constructs a new RobocodeFileOutputStream. See `FileOutputStream(String, boolean)` for documentation about this constructor.

Throws:
  `IOException`
See Also:
  - `FileOutputStream(String, boolean)`

## Method Details

### close

public final void close() throws IOException
Closes this output stream. See `FileOutputStream.close()` for documentation about this method.

Specified by:
  `close` in interface `AutoCloseable`
Specified by:
  `close` in interface `Closeable`
Overrides:
  `close` in class `OutputStream`
Throws:
  `IOException`
See Also:
  - `FileOutputStream.close()`

### flush

public final void flush() throws IOException
Flushes this output stream. See `OutputStream.flush()` for documentation about this method.

Specified by:
  `flush` in interface `Flushable`
Overrides:
  `flush` in class `OutputStream`
Throws:
  `IOException`
See Also:
  - `OutputStream.flush()`

### getName

public final String getName()
Returns the filename of this output stream.

Returns:
  the filename of this output stream.

### write

public final void write(byte[] b) throws IOException
Writes a byte array to this output stream. See `FileOutputStream.write(byte[])` for documentation about this method.

Overrides:
  `write` in class `OutputStream`
Throws:
  `IOException`
See Also:
  - `FileOutputStream.write(byte[])`

### write

public final void write(byte[] b, int off, int len) throws IOException
Writes a byte array to this output stream. See `FileOutputStream.write(byte[], int, int)` for documentation about this method.

Overrides:
  `write` in class `OutputStream`
Throws:
  `IOException`
See Also:
  - `FileOutputStream.write(byte[], int, int)`

### write

public final void write(int b) throws IOException
Writes a single byte to this output stream. See `FileOutputStream.write(int)` for documentation about this method.

Specified by:
  `write` in class `OutputStream`
Throws:
  `IOException`
See Also:
  - `FileOutputStream.write(int)`