public void WriteMatrix(int[,] matrix, SaveMode saveModeType) { var valuesToWrite = MatrixOperations.MatrixToUnidimensionalArray(matrix); var saveMode = SaveModeFactory.GetSaveMode(saveModeType); saveMode.WriteValues(valuesToWrite, bitWriter); }
public int[,] ReadMatrix(SaveMode saveModeType) { var saveMode = SaveModeFactory.GetSaveMode(saveModeType); var readValuesFromFile = saveMode.ReadValues(bitsToRead, bitReader); return(MatrixOperations.UnidimensionalArrayToSquareMatrix(readValuesFromFile)); }