Closed hughreeling closed 5 years ago
One other thought - didn't put too much care into the error handling - just threw exceptions - perhaps we need to do more there.
How about falling back to default Regex like the one we've been using?
Pattern pattern = Pattern.compile("--[_a-zA-Z0-9]*boundary\\s+(.*)\\r\\n\\r\\n",Pattern.DOTALL);
Good idea. I'll update tonight.
I made a change about falling back to a default pattern. Could you please check if you satisfy with that, if not, feel free to make any change you would like. Then, I can merge all these changes and release a new version. (Sorry, accidentally close the issue, re-opened)
Looks fantastic- nice. If you're good with it, I'm fine with merging.
When the connection to the stream is established, the headers contain 'Content-type' and this contains a 'boundary' string that identified the string used to delimit images in the stream. This change extracts this string, and uses is in the regex to identify the frame breaks.