Skip to content

Commit c166aa7

Browse files
committed
change default compressarraysize to 100
1 parent 3322f6f commit c166aa7

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

loadubjson.m

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,6 @@
3131
% the "name" tag is treated as a string. To load
3232
% these UBJSON data, you need to manually set this
3333
% flag to 1.
34-
% opt.Compression 'zlib' or 'gzip': specify array compression
35-
% method; currently only support 'gzip' or 'zlib'.
36-
% opt.CompressArraySize [0|int]: only compress arrays with a total
37-
% element count larger than this number.
3834
%
3935
% output:
4036
% dat: a cell array, where {...} blocks are converted into cell arrays,

savejson.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
% opt.Compact [0|1]: 1- out compact JSON format (remove all newlines and tabs)
7070
% opt.Compression 'zlib' or 'gzip': specify array compression
7171
% method; currently only support 'gzip' or 'zlib'.
72-
% opt.CompressArraySize [0|int]: only compress arrays with a total
72+
% opt.CompressArraySize [100|int]: only compress arrays with a total
7373
% element count larger than this number.
7474
% opt can be replaced by a list of ('param',value) pairs. The param
7575
% string is equivallent to a field in opt and is case sensitive.
@@ -389,7 +389,7 @@
389389
sep=ws.sep;
390390

391391
dozip=jsonopt('Compression','',varargin{:});
392-
zipsize=jsonopt('CompressArraySize',0,varargin{:});
392+
zipsize=jsonopt('CompressArraySize',100,varargin{:});
393393

394394
if(length(size(item))>2 || issparse(item) || ~isreal(item) || ...
395395
(isempty(item) && any(size(item))) ||jsonopt('ArrayToStruct',0,varargin{:}) || (~isempty(dozip) && numel(item)>zipsize))

saveubjson.m

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@
5555
% wrapped inside a function call as 'foo(...);'
5656
% opt.UnpackHex [1|0]: conver the 0x[hex code] output by loadjson
5757
% back to the string form
58+
% opt.Compression 'zlib' or 'gzip': specify array compression
59+
% method; currently only support 'gzip' or 'zlib'.
60+
% opt.CompressArraySize [100|int]: only compress arrays with a total
61+
% element count larger than this number.
5862
%
5963
% opt can be replaced by a list of ('param',value) pairs. The param
6064
% string is equivallent to a field in opt and is case sensitive.
@@ -294,7 +298,7 @@
294298
end
295299

296300
dozip=jsonopt('Compression','',varargin{:});
297-
zipsize=jsonopt('CompressArraySize',0,varargin{:});
301+
zipsize=jsonopt('CompressArraySize',100,varargin{:});
298302

299303
if(length(size(item))>2 || issparse(item) || ~isreal(item) || ...
300304
(isempty(item) && any(size(item))) ||jsonopt('ArrayToStruct',0,varargin{:}) || (~isempty(dozip) && numel(item)>zipsize))

0 commit comments

Comments
 (0)