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 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:
      length in interface dev.relism.fpr.core.ByteView
    • byteAt

      public byte byteAt(int index)
      Specified by:
      byteAt in interface dev.relism.fpr.core.ByteView
    • array

      public byte[] array()
      Description copied from interface: ArrayBackedByteView
      The backing array. Bytes [offset(), offset() + length()) belong to this view.
      Specified by:
      array in interface ArrayBackedByteView
    • offset

      public int offset()
      Description copied from interface: ArrayBackedByteView
      Offset of this view's first byte within ArrayBackedByteView.array().
      Specified by:
      offset in interface ArrayBackedByteView
    • supportsLong

      public boolean supportsLong()
      Specified by:
      supportsLong in interface dev.relism.fpr.core.ByteView
    • longAt

      public long longAt(int index)
      Specified by:
      longAt in interface dev.relism.fpr.core.ByteView
    • toString

      public String toString()
      Overrides:
      toString in class Object