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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T07:43:55+00:00 2026-05-30T07:43:55+00:00

I have a BinaryReader/BinaryWriter with a length of 1000 bytes, each record is 50

  • 0

I have a BinaryReader/BinaryWriter with a length of 1000 bytes, each record is 50 bytes. How can I eliminate the records at position 350 to 550 and in the end keep the remaining 800 bytes in my file?

  • 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-30T07:43:56+00:00Added an answer on May 30, 2026 at 7:43 am

    The simplest way would be to loop through the records, reading from one file and writing to a new one, and eliminating the records you don’t need.

    In theory you could seek within the same file, overwriting the “old” data with new data, but I’d personally go for a simple approach where possible. It also means that if anything fails half way through, you’ve still got the original file and a “bad” file which can just be deleted, rather than a file which may contain some records twice.

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

Sidebar

Related Questions

i have this line in c# : byte[] bytes = new byte[streamReader.BaseStream.Length]; That Length
I have the following class which uses BinaryReader internally and implements IDisposable. class DisposableClass
I have the following code: using (BinaryReader br = new BinaryReader( File.Open(FILE_PATH, FileMode.Open, FileAccess.ReadWrite)))
System.IO.BinaryReader reads values in a little-endian format. I have a C# application connecting to
I have a socket-based application that exposes received data with a BinaryReader object on
Hi i have got a TCP/IP Socket project. i can send string messages to
I have a binary file. It consists of 4 messages, each is inthe size
I have a binary file specification that describes a packetized data structure. Each data
In Silverlight 4, BinaryReader doesn't seem to have any ReadDecimal() method. Reflector shows that
The question... If you must have a BinaryReader opend to a file, is there

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.