This is an excerpt from hardware/arduino/cores/arduino/HardwareSerial.cpp (Arduino 1.0.1):
// Define constants and variables for buffering incoming serial data. We're
// using a ring buffer (I think), in which head is the index of the location
// to which to write the next incoming character and tail is the index of the
// location from which to read.
#if (RAMEND < 1000)
#define SERIAL_BUFFER_SIZE 16
#else
#define SERIAL_BUFFER_SIZE 64
#endif
Serial buffer size is not something you find on the mcu datasheet... it's just a software thing. But as Nick said, you shouldn't worry too much about buffer size as long as you keep read()ing data off of it.
Suppose you have an end-of-message marker, for example '*' (without the quotes). Let's also suppose the largest message you expect is 100 bytes long. Then you'd have something like (pseudocode!):
const int BUFSIZE = 101; // 1 byte for c string terminator
const char EOM = '*';
char buffer[BUFSIZE];
while Serial.available()
ch = Serial.read()
if ch == EOM then
parseBuf(buffer); // message complete: parse it and take actions
else
if there's still room in the buffer
store ch into buffer
else
// problem: incoming message is longer than expected...
endif
endif
end while
In all of this the serial buffer provided by Arduino is only used to store not-yet-read incoming bytes. Therefore, depending on how long it takes to parse and execute a message and the rate at which the messages come in, you should barley touch the 64-byte limit.
HTH