© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•16mo ago•
40 replies
daikirai

✅ Get bytes and append to List c#

public class ByteWriter {
    public MemoryStream Stream = new MemoryStream();
    public BinaryWriter Writer;

    public ByteWriter() {
        Writer = new BinaryWriter(Stream);
    }

    public void Write<T>(T value) {
        Writer.Write(value);
    }
}
public class ByteWriter {
    public MemoryStream Stream = new MemoryStream();
    public BinaryWriter Writer;

    public ByteWriter() {
        Writer = new BinaryWriter(Stream);
    }

    public void Write<T>(T value) {
        Writer.Write(value);
    }
}

im trying to write a method that will append the bytes for value to the stream
Stream
Stream
, T will be a variable amount of bytes so im taking it in as a generic type, but
Write
Write
doesnt have a generic overload
any ideas what i can do?
147B912C-536A-40D3-AB4E-9AF18F45857C.png
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Get minimum bytes needed for a number in c#
C#CC# / help
16mo ago
Replace Bytes To Another Bytes
C#CC# / help
2y ago
❔ Bytes to UInt64
C#CC# / help
3y ago
Reflection and customclass in list properties c#
C#CC# / help
2y ago