Exemplo n.º 1
0
        public void WriteMatrix(int[,] matrix, SaveMode saveModeType)
        {
            var valuesToWrite = MatrixOperations.MatrixToUnidimensionalArray(matrix);
            var saveMode      = SaveModeFactory.GetSaveMode(saveModeType);

            saveMode.WriteValues(valuesToWrite, bitWriter);
        }
Exemplo n.º 2
0
        public int[,] ReadMatrix(SaveMode saveModeType)
        {
            var saveMode = SaveModeFactory.GetSaveMode(saveModeType);

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

            return(MatrixOperations.UnidimensionalArrayToSquareMatrix(readValuesFromFile));
        }