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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T07:45:46+00:00 2026-05-24T07:45:46+00:00

Can somebody provide a source of public class CopyingInputStreamReader extends InputStreamReader { public CopyingInputStreamReader(InputStream

  • 0

Can somebody provide a source of

public class CopyingInputStreamReader extends InputStreamReader {
   public  CopyingInputStreamReader(InputStream is, OutputStream copyStream) {
  .....

The implementation should copy whatever got read to output stream. I have my implementation, but my HD crashed, so I need to recover it. Please respond in next 5 minutes, otherwise I will figure ot myself.

  • 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-24T07:45:47+00:00Added an answer on May 24, 2026 at 7:45 am

    Personally I wouldn’t do this at the reader level. I would write an InputStream which overrides all the methods methods from InputStream, delegating to the input stream that’s been passed to the constructor and writes to the output stream after each read, before returning the data to the caller. For example:

    @Override
    public int read(byte[] buffer, int start, int length) throws IOException
    {
        int ret = input.read(buffer, start, length);
        output.write(buffer, start, ret);
        return ret;
    }
    

    The reason I wouldn’t make at extend InputStreamReader is that the results of all the read operations would be text data – which you’d then need to write to your OutputStream somehow…

    Of course, if you really want to convert from one encoding to another, it would be worth extending Reader instead of InputStream, take another Reader to delegate to and a Writer to write to. Again, then you stay within one realm (text) instead of being part of the conversion yourself.

    EDIT: It strikes me that I forgot to mention you also need to override the non-read methods to either just delegate directly to the input stream, or throw an exception. (For example, you probably don’t want to support mark/reset.)

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

Sidebar

Related Questions

I've got the syntax down but I'm wondering if somebody can provide an illustrative
Can somebody explain to me why the following works: template<class T> class MyTemplateClass {
How to retrieve sitemap from databse in asp.net? Can somebody provide any link which
Can somebody please provide some sample code to strip diacritical marks (i.e., replace characters
I need google earth api for my iPhone application can somebody just provide idea
Can somebody provide a working example of JavaScriptResult in asp.net mvc. I understand that
Can somebody provide some best practices when storing special characters such as the trademark
Can somebody provide me link to a sample settings.xml ? My problem is that
Can somebody provide me a link or pseudocode of a function for finding all
Can somebody provide a example of this? I have tried null , string.Empty and

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.