Skip to content

Commit a4be125

Browse files
committed
for msgpack, use ArrayZipSize
1 parent 23f14d6 commit a4be125

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

jdatadecode.m

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,15 +105,16 @@
105105
end
106106
ndata=cast(data(j).(N_('_ArrayData_')),char(data(j).(N_('_ArrayType_'))));
107107
end
108+
if(~isempty(strmatch(N_('_ArrayZipSize_'),fn)))
109+
ndata=reshape(ndata(:),data(j).(N_('_ArrayZipSize_')));
110+
end
108111
iscpx=0;
109112
if(~isempty(strmatch(N_('_ArrayIsComplex_'),fn)))
110113
if(data(j).(N_('_ArrayIsComplex_')))
111114
iscpx=1;
112115
end
113116
end
114117
if(~isempty(strmatch(N_('_ArrayIsSparse_'),fn)) && data(j).(N_('_ArrayIsSparse_')))
115-
if(islogical(data(j).(N_('_ArrayIsSparse_'))))
116-
end
117118
if(~isempty(strmatch(N_('_ArraySize_'),fn)))
118119
dim=double(data(j).(N_('_ArraySize_'))(:)');
119120
if(iscpx)

saveubjson.m

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -529,6 +529,9 @@
529529
% General case, store row and column indices.
530530
fulldata=[ix,iy,data];
531531
end
532+
if(ismsgpack)
533+
txt=[txt,N_('_ArrayZipSize_'),I_a(size(fulldata))];
534+
end
532535
varargin{:}.ArrayToStruct=0;
533536
txt=[txt,N_('_ArrayData_'),...
534537
cell2ubjson('',num2cell(fulldata',2)',level+2,varargin{:})];
@@ -556,6 +559,10 @@
556559
txt=[txt,N_('_ArrayZipData_'), I_a(compfun(typecast(fulldata(:),'uint8')),Imarker(1),Imarker,varargin{:})];
557560
childcount=childcount+3;
558561
else
562+
if(ismsgpack)
563+
cid=I_(uint32(length(item(:))),Imarker,varargin{:});
564+
txt=[txt,N_('_ArrayZipSize_'),I_a([~isreal(item)+1 length(item(:))],cid(1),Imarker,varargin{:})];
565+
end
559566
if(isreal(item))
560567
txt=[txt,N_('_ArrayData_'),...
561568
matdata2ubjson(item(:)',level+2,varargin{:})];

0 commit comments

Comments
 (0)