Class FastPathViews.RequestByteView
java.lang.Object
dev.relism.flash.routing.routers.fastpathrouter.FastPathViews.RequestByteView
- All Implemented Interfaces:
ArrayBackedByteView,dev.relism.fpr.core.ByteView
- Enclosing class:
FastPathViews
public static final class FastPathViews.RequestByteView
extends Object
implements ArrayBackedByteView
bounds instead of requiring a fresh allocation.
RequestParser owns one pooled
instance per role (path/query/protocol) per connection and calls reset(byte[], int, int) on it for
every request, the same "do not retain past the handler" pooling contract every other
per-connection object in this codebase already follows (Http1HeaderMap,
RequestLine, Request, RequestBody). The public constructor remains
for one-shot, non-pooled use (tests, other call sites that build a single fixed view).-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbyte[]array()The backing array.bytebyteAt(int index) intlength()longlongAt(int index) intoffset()Offset of this view's first byte withinArrayBackedByteView.array().voidreset(byte[] buffer, int start, int length) Repositions this instance over new bounds.booleantoString()
-
Constructor Details
-
RequestByteView
public RequestByteView(byte[] buffer, int start, int length)
-
-
Method Details
-
reset
public void reset(byte[] buffer, int start, int length) Repositions this instance over new bounds. Zero allocation. -
length
public int length()- Specified by:
lengthin interfacedev.relism.fpr.core.ByteView
-
byteAt
public byte byteAt(int index) - Specified by:
byteAtin interfacedev.relism.fpr.core.ByteView
-
array
public byte[] array()Description copied from interface:ArrayBackedByteViewThe backing array. Bytes[offset(), offset() + length())belong to this view.- Specified by:
arrayin interfaceArrayBackedByteView
-
offset
public int offset()Description copied from interface:ArrayBackedByteViewOffset of this view's first byte withinArrayBackedByteView.array().- Specified by:
offsetin interfaceArrayBackedByteView
-
supportsLong
public boolean supportsLong()- Specified by:
supportsLongin interfacedev.relism.fpr.core.ByteView
-
longAt
public long longAt(int index) - Specified by:
longAtin interfacedev.relism.fpr.core.ByteView
-
toString
-