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 9136437
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T08:57:09+00:00 2026-06-17T08:57:09+00:00

I have an engine class that responsible to play streaming bytes with my Player

  • 0

I have an engine class that responsible to play streaming bytes with my Player class and write the bytes to file with my StreamWriter class.

I can have more than one engine and more than one players/writers.

Everything works fine until I need to close the file. when I say close I mean to add wave header and do some operation and then I dispose the writer and open a new writer to write the bytes.

My problem is that when the file is small its ok but when the file is larger (a few Mb) then the writer is null before I close the file. How can I avoid this?

Some code:
Engine class

AddBytesAndSave(byte,[] stream)
{
    writer.AddAndSave(stream);

    // here i think i must wait untill the operation complete
    writer.Dispose;
    writer = null;
}

Writer class

AddAndSave(byte[] stream)
{
    writrToFileWorker.RunWorkerAsync(stream);
}
  • 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-06-17T08:57:10+00:00Added an answer on June 17, 2026 at 8:57 am

    Obviously, or? When the Array is larger, it takes more time to physically write, and as you do not wait – well…

    Technically the Problem is that it makes – from your code – ZERO SENSE to run the write async. Totally None. No real advice needed – any refactoring depends on circumstances we do not know from your code snippet. Just – if the write is asyn, then obviously the writer should not be closed in the AddBytesAndSave method.

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

Sidebar

Related Questions

I have a Rails engine that defines a class method top(count) on a model
I have a Python App Engine web app class that I am accessing with
I'm working on a sync engine. I have a main engine class that gets
In my game engine I have a State class that represents the game world
I have a game engine class that creates my main character instance and game
hoping for advice on something. I have a Levels Engine class that creates an
I am writing a basic game engine and have an abstract class that represents
I have a model called Customer in google app engine with python: class Customer(db.Model):
I have two data sets in google app engine datastore. class First_Set(db.Model): start_time =
I have a engine style Rails plugin from which I can create a gem

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.