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

The Archive Base Latest Questions

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

The file is a UTF8 text files. Each characters has varying number of bytes

  • 0

The file is a UTF8 text files.

Each characters has varying number of bytes and each line has varying number of characters.

Does vb.net has table of line numbers to byte location function or something like that?

Also after that how to read that?

  • 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-01T08:56:36+00:00Added an answer on June 1, 2026 at 8:56 am

    The StreamReader class is the typical choice for line-by-line reading of a file. It does not maintain any history of what it reads in a file and thus does not know where the last line ended or where the next one will. When requested (via ReadLine), it simply processes characters until it reaches the new line string or the end of the file.

    I do not know the actual implementation of the StreamReader, but I would assume that it uses the Encoding class to handle multi-byte encodings and only maintains a small buffer of potentially pre-read data to improve read performance (reading chunks is better than just the 10 bytes you need now). Any other buffers, such as the characters in the current line, would be locals to functions like ReadLine that need them.

    If you need to seek randomly, you will need to use the BaseStream property to generate a table of line starts for yourself and then seek that stream to the beginning of the desired line. From there, you should be able to use ReadLine as usual.

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

Sidebar

Related Questions

Language: vb.net File size: 1GB, and stuff. Encoding of the text file: UTF8 (so
I am trying to create a text file using VB.Net with UTF8 encoding, without
0I am importing a text file encoded in UTF8 - without BOM usign a
I have a file with one phrase/terms each line which i read to perl
I have a text file that is encoded in UTF-8. I'm reading it in
I am reading a text file which I guess is encoded in utf-8. Some
I want to write out a text file. Instead of the default UTF-8, I
I am having utf-8 encoded file containing arabic text and I have to search
I have an XSD file that is encoded in UTF-8, and any text editor
I'm having trouble reading a file in UTF8 encoding into a wchar_t buffer as

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.