Binary Pattern Matching in Elixir

I've been working on a web client for my side project Grapevine, and part of that includes parsing a telnet stream. Before you ask, "A telnet stream!?", the web client connects to text-based games called MUDs that primarily used telnet as that's how they started in the late 1980s.

Telnet is mostly a TCP stream that contains only text that should be output to the screen. Hidden inside the otherwise plain TCP stream is a series of bytes called IAC (Interpret as Command). This is the byte 255 followed by at least one other byte that describes what the command is.