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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T01:13:59+00:00 2026-05-16T01:13:59+00:00

I recently read that in StringWriter and StringReader are used for writing and reading

  • 0

I recently read that in StringWriter and StringReader are used for writing and reading from StringBuilder.

Well when I use StringBuilder Object, it looks to be a self sufficient class.

We have every way of reading and writing the StringBuilder, using
StringBuilder.Append(), Insert(), Replace(), Remove() etc…

  1. What is the possible use of StringWriter and StringReader, which cannot be done by StringBuilder itself?
  2. What is the practical use of them?
  3. What could be the possible reason they are not taking up Stream as the input (Because any other writer and reader are taking the stream as the Constructor parameter to operate on) but the StringBuilder?
  • 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-16T01:13:59+00:00Added an answer on May 16, 2026 at 1:13 am

    What is the possible use of StringWriter and StringReader, which cannot be done by StringBuilder itself?

    StringReader and StringWriter derive from TextReader and TextWriter respectively. So what they can do act as a TextReader or TextWriter instance, which string or StringBuilder cannot because they do not derive either of those types.

    What is the practical use of them?

    They allow you to call APIs that are expecting a TextReader or TextWriter, when what you have/want is a string or StringBuilder.

    What could be the possible reason they are not taking up Stream as the input (Because any other writer and reader are taking the stream as the Constructor parameter to operate on) but the StringBuilder?

    Because they don’t work on streams; they work on strings or StringBuilders. They’re just simple wrapper classes that adapt these types for APIs expecting a different interface. See: adapter pattern.

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

Sidebar

Related Questions

Recently I have read that it makes sense when returning by value from a
I recently read about a new Google-code hosted (open source) project from Google that
I recently read that simply switching the render targets of a framebuffer object is
I recently read somewhere that writing a regexp to match an email address, taking
I recently read that the content provider content://sms shouldn't be used to access the
I read recently in a magazine that it's now possible to write / use
I recently read this list and I noticed that almost everything I studied from
I recently read that getters/setters are evil and I have to say it makes
I've read recently that iOS is message based. Is that similar to an event-based
I recently read in a presentation on Scribd that Facebook had benchmarked a variety

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.