User Tag List

Results 1 to 2 of 2

Thread: ZlibStream object by Darkwire Software

  1. #1
    Clickteam Clickteam
    Jeff's Avatar
    Join Date
    Jun 2006
    Location
    Battle Ground Washington
    Posts
    11,825
    Mentioned
    8 Post(s)
    Tagged
    2 Thread(s)

    ZlibStream object by Darkwire Software

    [size:17pt][color:#000000]ZlibStream object[/color][/size] v2 by Darkwire Software
    This object loads files, compresses/decompresses them, and saves them, much like the Binary object - except if you have a 4gb file, you don't need to use 4gb memory.
    This object will stream the file and compress/decompress it using a variable size buffer. It's multithreaded, so you can compress/decompress multiple files at once, without your program having to wait for it to finish.

    [color:#0000FF]Changelog:[/color]
    v1 >> v2:
    + Threadsafety
    + Supports appending
    + Alterable values & etc
    + Example file included
    + Help file included (DH1 standards)
    * New icon by Alonso
    - ReturnedValue removed

    [color:#0000FF]Conditions:[/color]
    On success:
    If a compression/decompression finishes successfully, this condition will trigger.
    On error:
    If a compression/decompression or buffer size failure occurs, this condition will trigger.

    [color:#0000FF]Actions:[/color]
    Compress a file: (string [color:#FF0000]Input[/color], string [color:#FF0000]Output[/color], bool [color:#FF0000]Use append[/color])
    The first parameter ([color:#FF0000]Input[/color]) is the file that is given to the object to compress, the second ([color:#FF0000]Output[/color]) is the file to place the compressed data. If the output file already exists, the third parameter ([color:#FF0000]Use append[/color]) is checked: if 0, the output file is overwritten. If 1, the output file is appended to.
    Decompress a file: (string [color:#FF0000]Input[/color], string [color:#FF0000]Output[/color])
    The first parameter ([color:#FF0000]Input[/color]) is the file that is given to the object to decompress, the second ([color:#FF0000]Output[/color]) is the file to place the decompressed data. If the output file already exists, the third parameter ([color:#FF0000]Use append[/color]) is checked: if 0, the output file is overwritten. If 1, the output file is appended to.
    Set buffer size: (number [color:#FF0000]New size[/color])
    Changes the default buffer size used to process the compressions - this is the number of bytes read from the input file each compression loop. Must be between 0 and 16385, exclusive - default is 8192.

    [color:#0000FF]Expressions:[/color]
    ReturnedString$
    The string returned. If the last compression/decompression was successful, it will return a description. Otherwise, it will return text telling you what went wrong.
    BufferSize
    The size of the buffer - the default bytes of memory used by the extension for each new compress/decompress action.
    Percentage
    The percentage difference between the input file size and the output file size. (eg 34.32%)
    LastOutputFile$
    The output file of the last compression/decompression that just finished. Vital when you're compressing/decompressing several files at once.

    This should be the final version of the object. As per Darkwire rules, any old code (such as use of ReturnedValue expression) causes popup messages reminding the developer to rewrite the old code. Also per rules, any new exporter conversion requests will be recorded and written if seen fit

    Enjoy!
    Attached files Attached files

  2. #2
    Clicker Fusion 2.5 MacFusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export ModuleUnicode Add-on
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)Firefly 3D Module (Steam)
    Phi's Avatar
    Join Date
    Jan 2010
    Location
    England
    Posts
    1,964
    Mentioned
    25 Post(s)
    Tagged
    0 Thread(s)

    Lightbulb ZlibStream v3 released!

    ZlibStream object v3
    This object loads files, compresses/decompresses them, and saves them, much like the Binary object - except if you have a 4gb file, you don't need to use 4gb memory.
    This object will stream the file and compress/decompress it using a variable size buffer. It's multithreaded, so you can compress/decompress multiple files at once, without your program having to wait for it to finish.

    Changelog:
    v2 >> v3:
    + Runtime library dependency removed; no external dependencies needed (thanks Jamie!)
    + More error-checking
    * Updated Darkwire logo in help file

    v1 >> v2:
    + Threadsafety
    + Supports appending
    + Alterable values & etc
    + Example file included
    + Help file included (DH1 standards)
    * New icon by Alonso
    - ReturnedValue removed

    Conditions:
    On success:
    If a compression/decompression finishes successfully, this condition will trigger.
    On error:
    If a compression/decompression or buffer size failure occurs, this condition will trigger.

    Actions:
    Compress a file: (string Input, string Output, bool Use append)
    The first parameter (Input) is the file that is given to the object to compress, the second (Output) is the file to place the compressed data. If the output file already exists, the third parameter (Use append) is checked: if 0, the output file is overwritten. If 1, the output file is appended to.
    Decompress a file: (string Input, string Output)
    The first parameter (Input) is the file that is given to the object to decompress, the second (Output) is the file to place the decompressed data. If the output file already exists, the third parameter (Use append) is checked: if 0, the output file is overwritten. If 1, the output file is appended to.
    Set buffer size: (number New size)
    Changes the default buffer size used to process the compressions - this is the number of bytes read from the input file each compression loop. Must be between 0 and 16385, exclusive - default is 8192.

    Expressions:
    ReturnedString$
    The string returned. If the last compression/decompression was successful, it will return a description. Otherwise, it will return text telling you what went wrong.
    BufferSize
    The size of the buffer - the default bytes of memory used by the extension for each new compress/decompress action.
    Percentage
    The percentage difference between the input file size and the output file size. (eg 34.32%)
    LastOutputFile$
    The output file of the last compression/decompression that just finished. Vital when you're compressing/decompressing several files at once.

    This should be the final version of the object. As per Darkwire rules, any old code (such as use of ReturnedValue expression) causes popup messages reminding the developer to rewrite the old code. Also per rules, any new exporter conversion requests will be recorded and written if seen fit
    An Anaconda version is in development and is written from this C++ code, so if you are interested in the style of the code you can view the Python version.

    Enjoy!

Similar Threads

  1. Midi object - DarkWire Software - plz help!
    By polymonsta in forum Multimedia Fusion 2 - Technical Support
    Replies: 6
    Last Post: 28th August 2012, 09:43 PM
  2. ZlibStream object v2 by Darkwire Software
    By DJ_Wild in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 6th August 2011, 06:53 PM
  3. ZlibStream object
    By Phi in forum Extension Development
    Replies: 11
    Last Post: 1st August 2011, 02:15 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •