Package dev.relism.flash.bytes
package dev.relism.flash.bytes
-
ClassDescriptionCapability interface for a
ByteViewthat is a contiguous slice of a single backingbyte[]— as opposed to aSegmentedByteView, which spans several arrays and cannot expose a single(array, offset)pair.The single home for protocol-neutral byte scanning: single-byte search, the four-byte\r\n\r\nheader-terminator search (SWAR-accelerated), case-insensitive comparison, comma-separated token-list scanning (Connection: a, b, c), RFC 9110tcharvalidation, and the case-insensitive header-name hashHttp1HeaderMap'sIndex-based writer into a growablebyte[]scratch buffer.The allocation-free idiom for returning twoints from a method without an object: pack both into onelong, unpack at the call site.per-callnew ByteView() { ... }anonymous-class allocation that used to live inHttp1HeaderMap.view,QueryParams.view, andPathParams.view: instead of allocating a fresh view object (plus its capturing instance) on every call, a smallSlicePoolof these hands out an existing instance, repositioned in place.AByteViewover up toKdiscontiguousbyte[]segments, presented as one logical byte sequence.A small, fixed-size ring ofPooledSliceinstances — one perConnectionScratch-Http1HeaderMap.view,QueryParams.view,PathParams.view).