Add writeAsBinary(raw_ostream &) method to BinaryRef.