Use library function for binary write