(updated)Help on Serial communication between Arduino and PC!!

I have changed my post into the original state, and here is some update.

it turns out that the problem is not with Arduino(I am using 1.0 IDE) at all, I tried my program on 2 linux computer using 2 USB-TTL adaptors, the problem remains, which I think is a good thing because the problem is how to program the serial ports rather than some bugs....

Background Idea

This is a part of my semester project, so it is kinda in a hurry. The basic idea is to transfer all the sensor data from Arduino to Raspberry Pi through UART, and then goes to PC through WIFI(dongle), I also send commands to RPi and then goes to Arduino via UART. And you are right, I need to define my own mini protocol, which is described below,

There are 3 frame types, sensor data, request data, and ACK, they all have fixed length, so no need for end marking stuff.
The sensor data has these data elements, others are much more simpler.
byte tag;
byte length;
unsigned long count;
unsigned short int intData[8];
float floatData[5];
byte verification;


Problems

Well, I have already programmed the protocol into Arduino, since it has problems, I have to make some small tests, so you will not find the protocol in the code below, it is simply a test to transfer 20 short int data. When I tried to send 3 int data, the send and receive seemed to work perfectly, everything is correct, but if I send 20 int data, the first 7 bytes were just missing on the receiver side(still don't know where is the problem).

Now, I know the code I wrote is really really crappy(I adapt from C into C++), which I don't really want put it up here to embarrass myself. But in case anyone want to find the problem, it is in my GDrive: [https://docs.google.com/open?id=0B-PlSu8oC8g-Q2RELWwxSUpxTk0]

So anyone care to introduce some similar examples on how to transfer the entire instance of a class(I didn't use struct because I need some methods), through the serial port ??

For example, how to send this via UART ?? and receive it on the other side properly ??

Thank you sooooo much !!

class SensorData
{
    public:
    byte tag;
    byte length;
    unsigned long count;
    unsigned short int intData[8];
    float floatData[5];
    byte verification;
};