Class ByteTemplate

java.lang.Object
dev.relism.flash.template.ByteTemplate

public final class ByteTemplate extends Object
Precompiled, allocation-minimal byte template.

Placeholders of the form {{name}} are detected once at construction. Each render(java.lang.String...) call makes exactly one allocation: the output byte[].

Layout: seg[0] slot[0] seg[1] slot[1] … seg[n-1] slot[n-1] seg[n]

  • Constructor Details

    • ByteTemplate

      public ByteTemplate(String source)
  • Method Details

    • render

      public byte[] render(String... kvPairs)
      Render with alternating key-value String pairs: k1, v1, k2, v2, … Unmatched slots are rendered as empty.