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