Encoding an entire Byte for File Reading I'm using an Arduino Yun to read from a data file, which will then populate a data structure. The file.read() function "returns: The next byte (or character), or -1 if none is available." 

This functionality is identical to the SD.read() function in the SD card library. 

The data file will never have any value that exceeds 1 byte with all numbers in the range 0-255. If I print these numbers as a long string in the data file, each character is read as a byte. So I need to call file.read() 3 times to read in a single 0-255 value. And then do some additional processing to construct the final 8-bit value for storing. 

I could reduce this to 2 calls by printing the Hex code in the data file, but this isn't much of an improvement. 

Is there a way to encode a full byte in a single character?

Effectively , is there a particular way I can format my data file so that I can read in an 8-bit unsigned value in a single call to file.read()?
This is a fragment (untested) of how you can do it:

char datafile[512];
int ch;
int index = 0;

while ((ch = file.read()) != -1) {
  datafile[i] = (char)ch;
  if (++i == 512)
    break;
}