Arena  1.0
A content management system
 All Classes Files Functions Variables Pages
Library.IO.FileStreams.AFileOutputStream Class Reference

This class represents a stream that is used to write binary information to a file. More...

+ Inheritance diagram for Library.IO.FileStreams.AFileOutputStream:

Public Member Functions

def __init__
 Construct a new file output stream instance and open fileName for writing. More...
 
def writeFormat
 Write the specified values to the stream. More...
 
- Public Member Functions inherited from Library.IO.FileStreams.AFileStream
def init
 Initialize a new file stream instance. More...
 
def close
 Close the file and flush any remaining data to disk. More...
 
def __del__
 Destroy the file stream instance. More...
 
def toString
 Return a string representation of the file stream. More...
 
def position
 Return the current position within the stream. More...
 
def moveTo
 Set the current position within the stream. More...
 
def length
 Return the current length of the stream, in bytes. More...
 
def fileName
 Retrieve the name of the file being streamed. More...
 
- Public Member Functions inherited from Library.IO.Streams.AStream
def __init__
 Construct a new stream instance. More...
 
def init
 Initialize the stream instance. More...
 
def readFormat
 Read one or more values from the stream. More...
 
def writeFormat
 Write one or more values to the stream. More...
 
def read
 Read one or more values from the stream. More...
 
def write
 Write the specified values to the stream. More...
 
def writeString
 Write a string to the stream, including a length specifier. More...
 
def readString
 Read a string from the stream. More...
 
def rewindBy
 Rewind the stream by the specified number of bytes.
 
def position
 Return the current position within the stream. More...
 
def moveTo
 Set the current position within the stream. More...
 
def length
 Get the current length of the stream, in bytes. More...
 
def __len__
 Get the current length of the stream, in bytes. More...
 
def hasEnded
 Determine whether or not the end of the stream has been reached. More...
 
- Public Member Functions inherited from Library.Base.Classwork.AnObject
def init
 Initialize a new object instance. More...
 
def __init__
 Construct and initialize a new instance of AnObject. More...
 
def __del__
 Destroy the object instance. More...
 
def displayName
 Construct a "pretty" display name for the class instance, based on the name of its class. More...
 
def implements
 Determine whether the class instance is related to the specified class. More...
 
def toString
 Return a string representation of the class, suitable for output to a console or text-based device. More...
 
def __str__
 Return a string representation of the class. More...
 
def classname
 Return the name of the class from which the instance was created. More...
 
def name
 Return the name of the class. More...
 

Detailed Description

This class represents a stream that is used to write binary information to a file.

Constructor & Destructor Documentation

def Library.IO.FileStreams.AFileOutputStream.__init__ (   Self,
  fileName,
  replace = False 
)

Construct a new file output stream instance and open fileName for writing.

If fileName does not exist, then it will be created. If replace is True and the file exists, then it will be truncated when it is opened, and any data previously contained within the file will be lost. Otherwise, the file is opened for appending.

Member Function Documentation

def Library.IO.FileStreams.AFileOutputStream.writeFormat (   Self,
  fmt,
  values 
)

Write the specified values to the stream.

If values is empty, then fmt is written to the stream. If an error occurs while writing, an exception will be raised.

Returns
This method returns a value that indicates how many bytes were written to the stream.

The documentation for this class was generated from the following file: