Class ItchCodec.View

java.lang.Object
com.quantfinlib.marketdata.ItchCodec.View
Enclosing class:
ItchCodec

public static final class ItchCodec.View extends Object
Mutable flyweight over one message in a caller-owned buffer. Reuse a single instance per decoding thread; every getter is a direct big-endian read. Getters are only meaningful for the message types that carry the field (per the ITCH layout) — reading a field the type does not carry returns garbage, exactly like pointing a C struct at the wrong bytes. Type-specific getters assert the type, so a misdispatched read fails loudly in every test run and costs nothing in production (assertions disabled).
  • Constructor Details

    • View

      public View()
  • Method Details

    • wrap

      public ItchCodec.View wrap(byte[] buffer, int offset)
      Points this view at a message; returns this for chaining.
    • type

      public byte type()
    • stockLocate

      public int stockLocate()
      Per-symbol locate code — the feed's symbol id for the day.
    • trackingNumber

      public int trackingNumber()
    • timestampNanos

      public long timestampNanos()
      Nanoseconds since midnight (48-bit wire field).
    • orderRef

      public long orderRef()
      Order reference (A/F/E/X/D/P, and the original ref of U via origRef()).
    • origRef

      public long origRef()
      U only: the replaced (original) order reference.
    • newRef

      public long newRef()
      U only: the new order reference.
    • side

      public byte side()
    • shares

      public long shares()
      A/F/P: displayed shares. U: the new total shares.
    • deltaShares

      public long deltaShares()
      E: executed shares. X: cancelled shares.
    • stock

      public long stock()
      A/F/P: symbol as 8 packed ASCII bytes (compare against ItchCodec.packStock(java.lang.String)).
    • priceTick

      public int priceTick()
      Price in 0.0001 ticks (A/F/P; U: the new price). Signed-int domain: wire prices above 2³¹−1 ticks decode negative (see the class doc's domain-limit note).
    • matchNumber

      public long matchNumber()
      E/P: the venue's match (execution) number.