public void WriteRow(PlainBufferRow row) { WriteTag(PlainBufferConsts.TAG_ROW_PK); foreach (PlainBufferCell cell in row.GetPrimaryKey()) { WriteCell(cell); } if (row.GetCells().Count > 0) { WriteTag(PlainBufferConsts.TAG_ROW_DATA); foreach (PlainBufferCell cell in row.GetCells()) { WriteCell(cell); } } if (row.HasDeleteMarker()) { WriteTag(PlainBufferConsts.TAG_DELETE_ROW_MARKER); } if (row.HasExtension()) { WriteExtension(row.GetExtension()); } WriteTag(PlainBufferConsts.TAG_ROW_CHECKSUM); output.WriteRawByte(row.GetChecksum()); }
public static int ComputePlainBufferRow(PlainBufferRow row) { int size = 0; size += 1; // TAG_ROW_PK foreach (PlainBufferCell cell in row.GetPrimaryKey()) { size += ComputePlainBufferCell(cell); } if (row.GetCells().Count > 0) { size += 1; // TAG_ROW_DATA foreach (PlainBufferCell cell in row.GetCells()) { size += ComputePlainBufferCell(cell); } } if (row.HasDeleteMarker()) { size += 1; // TAG_DELETE_MARKER } if (row.HasExtension()) { size += ComputePlainBufferExtension(row.GetExtension()); } size += 2; // TAG_ROW_CHECKSUM + checksum return(size); }