Preliminary: I am writting my own httpclient in Java. I am trying to parse out the contents of chunked encoding.
Here is my dilema: Since I am trying to parse out chunked http transfer encoding with a gzip payload there is a mix of ascii and binary. I can't just take the http resp content and convert it to a string and make use of StringUtils since the binary data can easily contain nil characters. So what I need to do is some basic things for parsing out each chunk and its chunk length (as per chunked transfer/HTTP/1.1 spec).
Are there any helpful ways of searching through byte arrays of binary/part ascii data for certain patterns (like a CR
LF
) (instead of just a single byte) ? Or must I write the for loops for this?