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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T17:25:15+00:00 2026-05-26T17:25:15+00:00

I have two streams that i want to combine into one stream. The first

  • 0

I have two streams that i want to combine into one stream. The first stream is user-defined stringStream class that inherits from System.IO.Stream class and the second stream is a networkStream , I created an array of Stream with stores those two streams and pass it to a user-defined class combinedStream constructor as parameter. Below are the lines of code

StringStream stringStream = new StringStream("test string");
Stream[] streamArray = new Stream[2];
streamArray[0] = stringStream;
streamArray[1] = nsStream;//NetworkStream instance parameter
CombinedStream combinedStream = new CombinedStream(streamArray);
this.nsStream = (NetworkStream)combinedStream;

This the error i got : “Cannot convert CombinedStream to NetworkStream”
What could be the reason?

  • 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-26T17:25:15+00:00Added an answer on May 26, 2026 at 5:25 pm

    Fairly simply, because CombinedStream (which is presumably your own class) is not a NetworkStream. I wouldn’t expect it to be.

    The big question is why nsStream is meant to be a NetworkStream anyway. Can you change the type so it’s just Stream instead? That should be fine unless you’re using any NetworkStream-specific methods… and if you’re doing that, then what would you expect to happen when those methods were called on a CombinedStream?

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

Sidebar

Related Questions

I have two web cameras and I want to merge their streams into a
I have two raw sound streams that I need to add together. For the
I have two classes that extend the activity class. Each class has it's own
I have two arrays, I want to merge these two arrays into single array.
I want to have two side-by-side areas where I will stream images to, passed
I have two streams of objects that each have a Timestamp value. Both streams
I have an incoming stream of messages, and want a window that allows the
I have some image-files stored into one file (some kind of archive). That file
Suppose I have a stream of [acme] objects that I want to expose via
I have a program that creates pipes between two processes. One process constantly monitors

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.