If I had written the code, I would have just returned null instead of throwing an exception if it couldn't connect over CAN, but maybe a null byte[] would be a possible value returned with communication. Just a thought, as this way you wouldn't need to add a try and catch statement when you read it. I do realize that this is a common practice with networking methods, though, so maybe it would in fact be best. I just feel that the readBuffer() method should handle the exception itself instead of throwing it.
If I had written the code, I would have just returned null instead of throwing an exception if it couldn't connect over CAN, but maybe a null byte[] would be a possible value returned with communication. Just a thought, as this way you wouldn't need to add a try and catch statement when you read it. I do realize that this is a common practice with networking methods, though, so maybe it would in fact be best. I just feel that the readBuffer() method should handle the exception itself instead of throwing it.