microsoft / microsoft/node-api-dotnet

Non-writeable MemoryStream shows up as Duplex rather than Readable

Open
#432 0 comments 0 reactions 1 assignee View on GitHub

@jasongin is already working on this.

Since Mar 14, 2025.

marshalling
Dominant language
C#
Stars
783
Forks
80
PR merge metrics
No merged PRs in 30d

Description

Per the the Stream docs, "A .NET Stream instance is marshalled to and from Node.js Duplex, Readable, or Writable, depending whether the stream supports reading and/or writing", however the following method:

public static Stream TestStream()
{
    return new MemoryStream(System.Text.Encoding.UTF8.GetBytes("hello"), false);
}

...seems to return a Duplex, even though I'd expect a Readable.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.