Add tryRead() and endian variants
Summary: Add a `tryRead()`, and endian variants, which try to read into an arithmetic type, and if there isn't enough data they return false. One use case is to quickly check if an IOBuf starts with a certain prefix, benchmarks show that using `tryReadLE()` is 6x faster than using `pullAtMost()` and `memcmp()`. Reviewed By: yfeldblum Differential Revision: D4767855 fbshipit-source-id: feb8c61092772933d4b8496b27d464559ff8b827
Showing
Please register or sign in to comment