コード例 #1
0
        public void WriteMatrix(int[,] matrix, SaveMode saveModeType)
        {
            var valuesToWrite = MatrixOperations.MatrixToUnidimensionalArray(matrix);
            var saveMode      = SaveModeFactory.GetSaveMode(saveModeType);

            saveMode.WriteValues(valuesToWrite, bitWriter);
        }
コード例 #2
0
        public int[,] ReadMatrix(SaveMode saveModeType)
        {
            var saveMode = SaveModeFactory.GetSaveMode(saveModeType);

            var readValuesFromFile = saveMode.ReadValues(bitsToRead, bitReader);

            return(MatrixOperations.UnidimensionalArrayToSquareMatrix(readValuesFromFile));
        }