Skip to content

fixed naming conventions and used RecyclableMemoryStream instead of M… - #4

Open
01Vladimir10 wants to merge 1 commit into
mlhpdx:mainfrom
01Vladimir10:main
Open

fixed naming conventions and used RecyclableMemoryStream instead of M…#4
01Vladimir10 wants to merge 1 commit into
mlhpdx:mainfrom
01Vladimir10:main

Conversation

@01Vladimir10

Copy link
Copy Markdown

…emoryStream

@mlhpdx

mlhpdx commented Feb 1, 2023

Copy link
Copy Markdown
Owner

Just FYI, I'm looking at this. The pooled memory stream seems like a win (here and in the seekable-s3-stream code as well).

@inbarbarkai

Copy link
Copy Markdown

I recommend getting a factory method in the constructor to create memory streams.
That way you can inject the manager you want to use.

Example:

class MyClass
{
    private readonly Func<MemoryStream> _streamFactory;

    public MyClass(Func<MemoryStream> streamFactory = null)
    {
        _streamFactory = streamFactory ?? () => new MemoryStream();
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants