Iterating Akka ByteString in reverse
<p>I receive data from a TCP server as <code>ByteString</code>. A message ends with the last byte being 0x03. For every <code>ByteString</code> I receive I need to check if last byte is 0x03. Right now I am calling <code>lastIndexof</code>.</p>

<pre><code>val data : ByteString = ...

if (data.lastIndexOf(0x03) &gt;= 0) {}
</code></pre>

<p>But this is inefficient since for most of the message chunks it will traverse all the bytes for no good reason. Is there any way to iterate through the bytes in reverse?</p>