Partial implemetation of Matrix.copyRawDataTo