Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compile-frame with pre-decoder method #30

Open
d-t-w opened this issue Oct 30, 2013 · 0 comments
Open

compile-frame with pre-decoder method #30

d-t-w opened this issue Oct 30, 2013 · 0 comments

Comments

@d-t-w
Copy link

d-t-w commented Oct 30, 2013

Hi Zach,

Currently compile-frame supports pre-encoder and post-decoder methods to manipulate the data-structure before/after use with a codec.

I'm currently using a third scenario - a pre-decoder method which manipulates the ByteBuffer being passed to a codec before decoding.

This is useful to me, because the RFC-5322 spec supports un-folding of headers before parsing, and I do that pre-decode.

A different solution would be to have a look-ahead style String codec which interpreted some byte sequences "\r\n\ " and "'\r\n\t" as simple space characters, but that seems more complicated, particularly as those byte sequences are super-sets of the "\r\n" delimiter.

More information here:
http://derek.troywest.com/articles/by-example-gloss/#gloss-extension

I could just parse my ByteBuffers prior to using the codec, but it seemed useful to append this transform method to the codec itself.

Again, I'm happy to supply a pull-request if you think it suitable.

Ta,
Derek

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

No branches or pull requests

1 participant