Версия для печати темы
Нажмите сюда для просмотра этой темы в оригинальном формате
Форум программистов > Общие вопросы по .NET и C# > Функция из MathLab (& java) в C#


Автор: NikB 15.2.2016, 12:23
Цитата
% DDECOMPRESS - decompress DZIP output to recover original data
%
%
% VARIABLES:
% Z = compressed variable to decompress
% M = decompressed output
%
% NOTES: (1) The input variable Z is created by the DZIP function and
%            is a vector of type uint8
%        (2) The decompressed output will have the same data type and
%            dimensions as the original data provided to DZIP.
%        (3) See DZIP for other notes.


function M = ddecompress(Z,op)

  import com.mathworks.mlwidgets.io.InterruptibleStreamCopier

  a=java.io.ByteArrayInputStream(Z);
  b=java.util.zip.InflaterInputStream(a);

  isc = InterruptibleStreamCopier.getInterruptibleStreamCopier;
  c = java.io.ByteArrayOutputStream;
  isc.copyStream(b,c);
  if op == 't'
     Q=typecast(c.toByteArray,'uint8');
  else
     Q=typecast(c.toByteArray,'single');
  end
  M=Q;
return


Я пробовал:
DeflateStream
GZipStream
GZipInputStream (Шарп)

но им не нравится хедер файла smile, т.е. я не знаю что пользовать.

Положил сдесь архив и деархив.

Буду признателен за любую помощь, идей, принципов

Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)