# Binary pattern matching when input is a stream

**URL:** <https://forum.elixirforum.com/t/binary-pattern-matching-when-input-is-a-stream/4286>\
**Category:** Questions\
**Created:** [March 24, 2017, 6:30pm UTC](https://forum.elixirforum.com/t/binary-pattern-matching-when-input-is-a-stream/4286 "2017-03-24T18:30:49Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![OvermindDL1](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/overminddl1/32/2677_2.png) [@OvermindDL1](https://forum.elixirforum.com/u/OvermindDL1)\
**Post date:** [March 24, 2017, 7:45pm UTC](https://forum.elixirforum.com/t/binary-pattern-matching-when-input-is-a-stream/4286/5 "2017-03-24T19:45:49Z")

</div>

> [@jeramyRR](#):
>
> Basically I need to pattern match on the binary to extract a massive amount of meta-data. I don’t want to use File.read! because that loads the whole file into memory and my VMs don’t have 20gb of ram.

What format is this data? You said it is dynamic but ‘how’? You’d need to know some bounds on how to split it, at the very least if a ‘section’ of data cannot be more than, oh, 1 meg then you can split at 1 meg boundaries with each section parsing 2 splits at a time with overlap handling to the next or so. Or if you do not want to parse a single file concurrently but rather serially then you can get data in chunks and parse on the fly in whole, or…?

---

_[View the full topic](https://forum.elixirforum.com/t/binary-pattern-matching-when-input-is-a-stream/4286)._
