The idea of a “binary code” was originally developed in the textile industry in pretty much this exact form. Remember punch cards? Probably not! They were a precursor to the floppy disc, and were used to store information in the same sort of binary code that we still use:
Here’s Mary Jackson (c.late 1950s) at a computer. If you look closely in the yellow box, you’ll see a stack of blank punch cards that she will use to store her calculations.
This is what a card might look like once punched. Note that the written numbers on the card are for human reference, and not understood by the computer.
But what does it have to do with textiles? Almost exactly what OP suggested. Now even though machine knitting is old as balls, I feel that there are few people outside of the industry or craft communities who have ever seen a knitting machine.
Here’s a flatbed knitting machine (as opposed to a round or tube machine), which honestly looks pretty damn similar to the ones that were first invented in the sixteenth century, and here’s a nice little diagram explaining how it works:
But what if you don’t just want a plain stocking stitch sweater? What if you want a multi-color design, or lace, or the like? You can quite easily add in another color and integrate it into your design, but for, say, a consistent intarsia (two-color repeating pattern), human error is too likely. Plus, it takes too long for a knitter in an industrial setting. This is where the binary comes in!
Here’s an intarsia swatch I made in my knitwear class last year. As you can see, the front of the swatch is the inverse of the back. When knitting this, I put a punch card in the reader,
and as you can see, the holes (or 0′s) told the machine not to knit the ground color (1′s) and the machine was set up in such a way that the second color would come through when the first color was told not to knit.
tl;dr the textiles industry is more important than people give it credit for, and I would suggest using a machine if you were going to try to knit almost 3 megabytes of information.