f = File.open("data", "r:binary") # Open data file for binary reads c = f.getc # Read the first byte as an integer f.ungetc(c) # Push that byte back c = f.readchar # Read it back again