Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 631047
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T19:55:19+00:00 2026-05-13T19:55:19+00:00

I am trying to read a very large file in AS3 and am having

  • 0

I am trying to read a very large file in AS3 and am having problems with the runtime just crashing on me. I’m currently using a FileStream to open the file asynchronously. This does not work(crashes without an Exception) for files bigger than about 300MB.

_fileStream = new FileStream();
_fileStream.addEventListener(IOErrorEvent.IO_ERROR, loadError);
_fileStream.addEventListener(Event.COMPLETE, loadComplete);
_fileStream.openAsync(myFile, FileMode.READ);

In looking at the documentation, it sounds like the FileStream class still tries to read in the entire file to memory(which is bad for large files).

Is there a more suitable class to use for reading large files? I really would like something like a buffered FileStream class that only loads the bytes from the files that are going to be read next.

I’m expecting that I may need to write a class that does this for me, but then I would need to read only a piece of a file at a time. I’m assuming that I can do this by setting the position and readAhead properties of the FileStream to read a chunk out of a file at a time. I would love to save some time if there is a class like this that already exists.

Is there a good way to process large files in AS3, without loading entire contents into memory?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T19:55:19+00:00Added an answer on May 13, 2026 at 7:55 pm

    Can’t you create a stream, and read a chunk of bytes at a given offset, a chunk at a time… so:

    function readPortionOfFile(starting:int, size:int):ByteArray
    {
        var bytes:ByteArray ...
        var fileStream:FileStream ...    
    
        fileStream.open(myFile);
        fileStream.readBytes(bytes, starting, size);
        fileStream.close();
    
        return bytes;
    }
    

    and then repeat as required. I don’t know how this works, and haven’t tested it, but I was under the impression that this works.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to read a very simple but somehow large(800Mb) csv file using
I have a very large zip file and i am trying to read it
I am trying to read data from a very large binary file and process
Trying to read headers for a csv file with: reader = csv.DictReader(open(PATH_FILE),skipinitialspace=True) headers =
I'm currently trying to read the contents of an XML file into a Map
I'm trying to read a very large input as String and then converting it
I am trying to read an SPSS file in to R using read.spss. It
I'm very new at JSON, I'm trying to read one parameter of this file
I'm trying to use VB.NET to process a very large plain text file (2 GB).
I am trying to open a file within a large code. I was told

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.