### robocode

# Class RobocodeFileOutputStream

- `OutputStream`
- - `robocode.RobocodeFileOutputStream`

`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).

Authors:
  Mathew A. Nelson (original)
  Flemming N. Larsen (contributor)

See Also:
  `AdvancedRobot.getDataFile(String)`, `FileOutputStream`

  ## Constructor Summary

  `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

  `String`

  `getName()`
    Returns the filename of this output stream.

  `void`

  `setFileOutputStream(FileOutputStream out)`
    The system calls this method, you should not call it.

  `static void`

  `setThreadManager(robocode.manager.IThreadManager threadManager)`
    The system calls this method, you should not call it.

  `@Override`

  `void close()`
    Closes this output stream.

  `@Override`

  `void flush()`
    Flushes this output stream.

  `@Override`

  `void write(byte[] b)`
    Writes a byte array to this output stream.

  `@Override`

  `void write(byte[] b, int off, int len)`
    Writes a byte array to this output stream.

  `@Override`

  `void write(int b)`
    Writes a single byte to this output stream.

## Constructor Details

### RobocodeFileOutputStream

    public RobocodeFileOutputStream(File file)
                throws IOException

> Constructs a new RobocodeFileOutputStream. See `FileOutputStream.FileOutputStream(File)` for documentation about this constructor.
> See Also:
>   `FileOutputStream.FileOutputStream(File)`

### RobocodeFileOutputStream

    public RobocodeFileOutputStream(FileDescriptor fdObj)

> Constructs a new RobocodeFileOutputStream. See `FileOutputStream.FileOutputStream(FileDescriptor)` for documentation about this constructor.
> See Also:
>   `FileOutputStream.FileOutputStream(FileDescriptor)`

### RobocodeFileOutputStream

    public RobocodeFileOutputStream(String fileName)
                throws IOException

> Constructs a new RobocodeFileOutputStream. See `FileOutputStream.FileOutputStream(String)` for documentation about this constructor.
> See Also:
>   `FileOutputStream.FileOutputStream(String)`

### RobocodeFileOutputStream

    public RobocodeFileOutputStream(String fileName,
                                    boolean append)
                throws IOException

> Constructs a new RobocodeFileOutputStream. See `FileOutputStream.FileOutputStream(String, boolean)` for documentation about this constructor.
> See Also:
>   `FileOutputStream.FileOutputStream(String, boolean)`

## Method Details

### getName

    public final String getName()

> Returns the filename of this output stream.
> Returns:
>   the filename of this output stream.

### setFileOutputStream

    public final void setFileOutputStream(FileOutputStream out)

> The system calls this method, you should not call it.

### setThreadManager

    public static void setThreadManager(robocode.manager.IThreadManager threadManager)

> The system calls this method, you should not call it.

### void close

    public final @Override void close()
                throws IOException

> Closes this output stream. See `FileOutputStream.close()` for documentation about this method.
> See Also:
>   `FileOutputStream.close()`

### void flush

    public final @Override void flush()
                throws IOException

> Flushes this output stream. See `FileOutputStream.flush()` for documentation about this method.
> See Also:
>   `FileOutputStream.flush()`

### void write

    public final @Override void write(byte[] b)
                throws IOException

> Writes a byte array to this output stream. See `FileOutputStream.write(byte[])` for documentation about this method.
> See Also:
>   `FileOutputStream.write(byte[])`

### void write

    public final @Override 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.
> See Also:
>   `FileOutputStream.write(byte[], int, int)`

### void write

    public final @Override void write(int b)
                throws IOException

> Writes a single byte to this output stream. See `FileOutputStream.write(int)` for documentation about this method.
> See Also:
>   `FileOutputStream.write(int)`