Beispiel #1
0
        public override int Serialize(int offset, byte[] data)
        {
            int nBreaks = _breaks.Count;

            if (!IS_EMPTY_RECORD_WRITTEN && nBreaks < 1)
            {
                return(0);
            }
            int dataSize = DataSize;

            LittleEndian.PutUShort(data, offset + 0, Sid);
            LittleEndian.PutUShort(data, offset + 2, dataSize);
            LittleEndian.PutUShort(data, offset + 4, nBreaks);
            int pos = 6;

            for (int i = 0; i < nBreaks; i++)
            {
                Break br = (Break)_breaks[i];
                pos += br.Serialize(offset + pos, data);
            }

            return(4 + dataSize);
        }