FileStream

From Web Computing Documentation
Revision as of 13:19, 11 September 2011 by Admin (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

class FileStream implements Persistent

  • web2grid
    • web2grid.core
      • web2grid.core.work
        • web2grid.core.work.FileStream


Class overview

The FileStream class can be used for String storage implementing the Persistent interface.

Public functions

new (?url : String, readonly : Bool)

url optional URL specifying the address of the resource.
readonly optional Bool indicating whether the FileStream is readonly.

Constructor, has one optional parameter. If specified the FileStream once such an object is created or restored it immediately starts downloading the resource and sets its state to ready. If the readonly parameter is set to true contents of the FileStream only the url will be saved during serialization and not its content.

write (s : String)

s The string with which you add to the content of the FileStream.

Appends the content of the stream with the given String.

setContent (s : String)

s A string to replace the content.

Replaces the content of the FileStream with the given string.

getContent () : String

Returns the FileStream content.

getHash () : String

Returns the MD5 hash of the FileStream's content.

getSize () : Int

Returns the length (number of characters) of the FileStream's content.

getCreateDate () : Date

Returns the datetime when the FileStream was created.

copyFrom (stream : FileStream)

Copies the content from another FileStream.

clear ()

Clears the content of the FileStream.

isChanged () : Bool

Returns whether the FileStream has been changed since the last serialization (checkpointing).

hxSerialize (s : haxe.Serializer)

s A Serializer object in which the FileStream's content will be serialized.

Required by the Persistent interface. Passes the FileStream for serialization to the Serializer object.

unSerialize (s : haxe.Unserializer)

s An Unserializer from which the object can be retrieved.

Required by the Persistent interface. Retrieves the FileStream object from the Unserializer.

Personal tools
Modules