diff --git a/loadubjson.m b/loadubjson.m index b637b29..20a2f07 100644 --- a/loadubjson.m +++ b/loadubjson.m @@ -31,10 +31,6 @@ % the "name" tag is treated as a string. To load % these UBJSON data, you need to manually set this % flag to 1. -% opt.Compression 'zlib' or 'gzip': specify array compression -% method; currently only support 'gzip' or 'zlib'. -% opt.CompressArraySize [0|int]: only compress arrays with a total -% element count larger than this number. % % output: % dat: a cell array, where {...} blocks are converted into cell arrays, diff --git a/savejson.m b/savejson.m index 650f3db..0519cdd 100644 --- a/savejson.m +++ b/savejson.m @@ -69,7 +69,7 @@ % opt.Compact [0|1]: 1- out compact JSON format (remove all newlines and tabs) % opt.Compression 'zlib' or 'gzip': specify array compression % method; currently only support 'gzip' or 'zlib'. -% opt.CompressArraySize [0|int]: only compress arrays with a total +% opt.CompressArraySize [100|int]: only compress arrays with a total % element count larger than this number. % opt can be replaced by a list of ('param',value) pairs. The param % string is equivallent to a field in opt and is case sensitive. @@ -389,7 +389,7 @@ sep=ws.sep; dozip=jsonopt('Compression','',varargin{:}); -zipsize=jsonopt('CompressArraySize',0,varargin{:}); +zipsize=jsonopt('CompressArraySize',100,varargin{:}); if(length(size(item))>2 || issparse(item) || ~isreal(item) || ... (isempty(item) && any(size(item))) ||jsonopt('ArrayToStruct',0,varargin{:}) || (~isempty(dozip) && numel(item)>zipsize)) diff --git a/saveubjson.m b/saveubjson.m index a5462be..6b4dac0 100644 --- a/saveubjson.m +++ b/saveubjson.m @@ -55,6 +55,10 @@ % wrapped inside a function call as 'foo(...);' % opt.UnpackHex [1|0]: conver the 0x[hex code] output by loadjson % back to the string form +% opt.Compression 'zlib' or 'gzip': specify array compression +% method; currently only support 'gzip' or 'zlib'. +% opt.CompressArraySize [100|int]: only compress arrays with a total +% element count larger than this number. % % opt can be replaced by a list of ('param',value) pairs. The param % string is equivallent to a field in opt and is case sensitive. @@ -294,7 +298,7 @@ end dozip=jsonopt('Compression','',varargin{:}); -zipsize=jsonopt('CompressArraySize',0,varargin{:}); +zipsize=jsonopt('CompressArraySize',100,varargin{:}); if(length(size(item))>2 || issparse(item) || ~isreal(item) || ... (isempty(item) && any(size(item))) ||jsonopt('ArrayToStruct',0,varargin{:}) || (~isempty(dozip) && numel(item)>zipsize))