Skip to content

Conversation

@amaitland
Copy link
Member

Add ability to specify encoding and include a preamble with using the ResourceHandler.

Resolves issue #689

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Preable -> Preamble

@jankurianski
Copy link
Member

I tested it out, works perfect 👍

@amaitland
Copy link
Member Author

Fixed the spelling mistakes, thanks 👍

amaitland added a commit that referenced this pull request Dec 16, 2014
…coding

Enhancement - ResourceHandler Encoding
@amaitland amaitland merged commit add83d9 into cefsharp:master Dec 16, 2014
@amaitland amaitland deleted the enhancement/resourcehandler-encoding branch December 16, 2014 03:23
@amaitland
Copy link
Member Author

I had a quick look to see if there was a more elegant way to write the Preamble. Haven't found anything yet. So we'll just go with this for now, it seems to work, and should be fairly efficient.

@jankurianski
Copy link
Member

There is a "nicer looking" alternative that uses StreamWriter to write the encoding, but it is just as efficient as what you've got.

However, I think this will save the internal byte array of MemoryStream from being expanded unnecessarily:

var memoryStream = new MemoryStream(preamble.Length + bytes.Length);

@amaitland
Copy link
Member Author

Nice finishing touch 👍 Thanks 😄

f805f50

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.

2 participants