You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
New API, BufferedSource.indexOf(ByteString, fromIndex, toIndex) (#1626)
* New API, BufferedSource.indexOf(ByteString, fromIndex, toIndex)
This is surprisingly interesting. To minimize unnecessary reads for
toIndex it is necessary to check whether a prefix of the query matches
a suffix of the currently-loaded data.
This read-avoidance is useful in practice. When doing HTTP multipart
decoding the caller may scan for a boundary separator with a bounded
range, and we don't want to block reading when doing so won't impact
the result of the call.
* apiDump
* Check both maximum and minimum prefix sizes
---------
Co-authored-by: Jesse Wilson <[email protected]>
0 commit comments