java port of ry's http-parser