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

  • Home
  • SEARCH
  • 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 7746127
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T10:11:56+00:00 2026-06-01T10:11:56+00:00

We have our own data streaming algorithm that include some metadata+records+fields values. Currently we

  • 0

We have our own data streaming algorithm that include some metadata+records+fields values.

Currently we use a TStream and write to add values to the stream.
Now I’m wondering if this time cosuming operation could be made faster by using some technic.

Edit: We are only appending data to the end, not moving or seeking.

Some things I was thinking of are:

  • Not use Streams buf some large memory allocated buffer to copy data to, the problem is if we go beyond the buffer size, then we have to relocate to some new memory space.
  • Use a Stream prefilled with #0s to some size and then start adding values. The rationale is that Tstream have to allocate it’s own buffer every time I do a write (I don’t know how it really works, just wondering…)

We are adding strings to the TStream and binary data in the form #0#0#0#1 for example.

The data is then transfered via TCP, so it’s not about write to a File.

So what is the best method for this?

  • 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-01T10:11:57+00:00Added an answer on June 1, 2026 at 10:11 am

    Overwrite TMemoryStream and remove the restriction of Size and Capacity. And do not call TMemoryStream.Clear but call TMemoryStream.SetSize(0)

    type
      TMemoryStreamEx = class(TMemoryStream)
      public
        procedure SetSize(NewSize: Longint); override;
        property Capacity;
      end;
    
    implementation
    
    { TMemoryStreamEx }
    
    procedure TMemoryStreamEx.SetSize(NewSize: Integer);
    var
      OldPosition: Longint;
    begin
      if NewSize > Capacity then
        inherited SetSize(NewSize)
      else
      begin
        OldPosition := Position;
        SetPointer(Memory, NewSize);
        if OldPosition > NewSize then
          Seek(0, soFromEnd);
      end;
    end;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have our own ORM we use here, and provide strongly typed wrappers for
I have a ASP.NET application that we've written our own logging module for. My
Currently using System.Web.UI.WebControls.FileUpload wrapped in our own control. We have licenses for Telerik. I
Our inHouse tech have installed our own app to some of our iPods 3.x
We have some code in which we need to maintain our own identity (PK)
We have our own blog system and the post data is stores a raw
We are using Linq To SQL with our own data context logic that executes
We are using Linq To SQL with our own data context logic that executes
We have lots of WCF services that are only used by our own code;
In some project we have very that even our staff is not suppose to

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.