3

I have a string I need to feed to a com object that has a LoadFromStream method accepting "object Data". I'm guessing this should be a byte[].

Rather basic question: I got my MemoryStream all filled and ready to go. What's the best way to convert it to binary[]? Should I manually read it into the array one by one or is there an easy built in way?

1 Answer 1

2

MemoryStream has a ToArray() method which returns a byte[].

Sign up to request clarification or add additional context in comments.

1 Comment

Doh, once again I miss the obvious :P

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.