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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T16:16:26+00:00 2026-05-21T16:16:26+00:00

I am on the stage of development where I have two modules and from

  • 0

I am on the stage of development where I have two modules and from one I got output as a OutputStream, and a second one which accepts only InputStream.

Do you know how to convert OutputStream to InputStream (not vice versa, I mean really this way) so that I am able to connect these two parts?

  • 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-21T16:16:26+00:00Added an answer on May 21, 2026 at 4:16 pm

    An OutputStream is one where you write data to. If some module exposes an OutputStream, the expectation is that there is something reading at the other end.

    Something that exposes an InputStream, on the other hand, is indicating that you will need to listen to this stream, and there will be data that you can read.

    So it is possible to connect an InputStream to an OutputStream

    InputStream----read---> intermediateBytes[n] ----write----> OutputStream

    As someone metioned, this is what the copy() method from IOUtils lets you do. It does not make sense to go the other way… hopefully this makes some sense

    UPDATE:

    Of course the more I think of this, the more I can see how this actually would be a requirement. I know some of the comments mentioned Piped input/ouput streams, but there is another possibility.

    If the output stream that is exposed is a ByteArrayOutputStream, then you can always get the full contents by calling the toByteArray() method. Then you can create an input stream wrapper by using the ByteArrayInputStream sub-class. These two are pseudo-streams, they both basically just wrap an array of bytes. Using the streams this way, therefore, is technically possible, but to me it is still very strange…

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

Sidebar

Related Questions

I have a Ruby on Rails application that has two active environments, Stage and
I have a Facelet that has two <h:forms> . The command link in one
I have a big issue with my current development stage on a project that
I don't have any experience with SVN and TortoiseSVN. In some stage of development
I have e.g. two branches. master and development. I created a branch called master_fix.
I have the following animation set up using Three.js: http://frontier.lincoln.ac.uk/3d/development/Stage2/characters/man2.html Please ignore the ropey
I'm interested at what stage in your development do add logging and/or tracing to
My stage have 3 movieclip that is mc1,mc2 and mc3. each of them are
I'm using the Windows Launcher development environment for Google App Engine. I have downloaded
I've recently returned to C++ development after a hiatus, and have a question regarding

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.