code: func (ih *InnerHeader) readFrom(r io.Reader) error {
  	binaryCount := 0 // Var used to count and index every binary
  	for {
  		var headerType byte
  		var length int32
  		var data []byte
  
  		if err := binary.Read(r, binary.LittleEndian, &headerType); err != nil {
  			return err
  		}
  		if err := binary.Read(r, binary.LittleEndian, &length); err != nil {
  			return err
  		}
  		data = make([]byte, length)
  		if err := binary.Read(r, binary.LittleEndian, &data); err != nil {
  			return err
  		}
  
  		if headerType == InnerHeaderTerminator {
  			// End of inner header
  			break
  		} else if headerType == InnerHeaderIRSID {
  			// Found InnerRandomStream ID
  			ih.InnerRandomStreamID = binary.LittleEndian.Uint32(data)
  		} else if headerType == InnerHeaderIRSKey {
  			// Found InnerRandomStream Key
  			ih.InnerRandomStreamKey = data
  		} else if headerType == InnerHeaderBinary {
  			// Found a binary
  			var protection byte
  			reader := bytes.NewReader(data)
  
  			binary.Read(reader, binary.LittleEndian, &protection) // Read memory protection flag
  			content, _ := ioutil.ReadAll(reader)                  // Read content
  
  			ih.Binaries = append(ih.Binaries, Binary{
  				ID:               binaryCount,
  				MemoryProtection: protection,
  				Content:          content,
  			})
  
  			binaryCount = binaryCount + 1
  		} else {
  			return ErrUnknownInnerHeaderID(headerType)
  		}
  	}
  	return nil
  }
docs: // readFrom reads the InnerHeader from an io.Reader