Ruby - Output file byte by type