Package robocode
Class RobocodeFileOutputStream
- java.lang.Object
-
- java.io.OutputStream
-
- robocode.RobocodeFileOutputStream
-
- All Implemented Interfaces:
java.io.Closeable
,java.io.Flushable
,java.lang.AutoCloseable
public class RobocodeFileOutputStream extends java.io.OutputStream
RobocodeFileOutputStream is similar to aFileOutputStream
and is used for streaming/writing data out to a file, which you got previously by callinggetDataFile()
.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(java.io.File file)
Constructs a new RobocodeFileOutputStream.RobocodeFileOutputStream(java.io.FileDescriptor fdObj)
Constructs a new RobocodeFileOutputStream.RobocodeFileOutputStream(java.lang.String fileName)
Constructs a new RobocodeFileOutputStream.RobocodeFileOutputStream(java.lang.String fileName, boolean append)
Constructs a new RobocodeFileOutputStream.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Closes this output stream.void
flush()
Flushes this output stream.java.lang.String
getName()
Returns the filename of this output stream.void
write(byte[] b)
Writes a byte array to this output stream.void
write(byte[] b, int off, int len)
Writes a byte array to this output stream.void
write(int b)
Writes a single byte to this output stream.
-
-
-
Constructor Detail
-
RobocodeFileOutputStream
public RobocodeFileOutputStream(java.io.File file) throws java.io.IOException
Constructs a new RobocodeFileOutputStream. SeeFileOutputStream(File)
for documentation about this constructor.- Throws:
java.io.IOException
- See Also:
FileOutputStream(File)
-
RobocodeFileOutputStream
public RobocodeFileOutputStream(java.io.FileDescriptor fdObj)
Constructs a new RobocodeFileOutputStream. SeeFileOutputStream(FileDescriptor)
for documentation about this constructor.- See Also:
FileOutputStream(FileDescriptor)
-
RobocodeFileOutputStream
public RobocodeFileOutputStream(java.lang.String fileName) throws java.io.IOException
Constructs a new RobocodeFileOutputStream. SeeFileOutputStream(String)
for documentation about this constructor.- Throws:
java.io.IOException
- See Also:
FileOutputStream(String)
-
RobocodeFileOutputStream
public RobocodeFileOutputStream(java.lang.String fileName, boolean append) throws java.io.IOException
Constructs a new RobocodeFileOutputStream. SeeFileOutputStream(String, boolean)
for documentation about this constructor.- Throws:
java.io.IOException
- See Also:
FileOutputStream(String, boolean)
-
-
Method Detail
-
close
public final void close() throws java.io.IOException
Closes this output stream. SeeFileOutputStream.close()
for documentation about this method.- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Overrides:
close
in classjava.io.OutputStream
- Throws:
java.io.IOException
- See Also:
FileOutputStream.close()
-
flush
public final void flush() throws java.io.IOException
Flushes this output stream. SeeOutputStream.flush()
for documentation about this method.- Specified by:
flush
in interfacejava.io.Flushable
- Overrides:
flush
in classjava.io.OutputStream
- Throws:
java.io.IOException
- See Also:
OutputStream.flush()
-
getName
public final java.lang.String getName()
Returns the filename of this output stream.- Returns:
- the filename of this output stream.
-
write
public final void write(byte[] b) throws java.io.IOException
Writes a byte array to this output stream. SeeFileOutputStream.write(byte[])
for documentation about this method.- Overrides:
write
in classjava.io.OutputStream
- Throws:
java.io.IOException
- See Also:
FileOutputStream.write(byte[])
-
write
public final void write(byte[] b, int off, int len) throws java.io.IOException
Writes a byte array to this output stream. SeeFileOutputStream.write(byte[], int, int)
for documentation about this method.- Overrides:
write
in classjava.io.OutputStream
- Throws:
java.io.IOException
- See Also:
FileOutputStream.write(byte[], int, int)
-
write
public final void write(int b) throws java.io.IOException
Writes a single byte to this output stream. SeeFileOutputStream.write(int)
for documentation about this method.- Specified by:
write
in classjava.io.OutputStream
- Throws:
java.io.IOException
- See Also:
FileOutputStream.write(int)
-
-