Skip to content

Commit 95bcf3e

Browse files
committed
[zmat] fix base64encode trailing newline, disable jvm warning
1 parent 36bfa2a commit 95bcf3e

3 files changed

Lines changed: 1 addition & 27 deletions

File tree

base64encode.m

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
end
3434

3535
if (exist('zmat', 'file') == 2 || exist('zmat', 'file') == 3)
36-
[varargout{1:nargout}] = zmat(varargin{1}, 1, 'base64', varargin{2:end});
36+
[varargout{1:nargout}] = zmat(varargin{1}, 2, 'base64', varargin{2:end});
3737
return
3838
end
3939

@@ -45,7 +45,6 @@
4545

4646
if (isoctavemesh)
4747
varargout{1} = base64_encode(uint8(input));
48-
varargout{1} = regexprep(varargout{1}, '[\r\n]', '');
4948
return
5049
end
5150

savebj.m

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -195,18 +195,6 @@
195195
if (~ismember(dozip, {'zlib', 'gzip', 'lzma', 'lzip', 'lz4', 'lz4hc'}) && isempty(regexp(dozip, '^blosc2', 'once')))
196196
error('compression method "%s" is not supported', dozip);
197197
end
198-
if (exist('zmat', 'file') ~= 2 && exist('zmat', 'file') ~= 3)
199-
try
200-
error(javachk('jvm'));
201-
try
202-
base64decode('test');
203-
catch
204-
matlab.net.base64decode('test');
205-
end
206-
catch
207-
error('java-based compression is not supported');
208-
end
209-
end
210198
end
211199

212200
if (~opt.messagepack)

savejson.m

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -204,19 +204,6 @@
204204
if (~ismember(dozip, {'zlib', 'gzip', 'lzma', 'lzip', 'lz4', 'lz4hc'}) && isempty(regexp(dozip, '^blosc2', 'once')))
205205
error('compression method "%s" is not supported', dozip);
206206
end
207-
if (exist('zmat', 'file') ~= 2 && exist('zmat', 'file') ~= 3)
208-
try
209-
error(javachk('jvm'));
210-
try
211-
base64decode('test');
212-
catch
213-
matlab.net.base64decode('test');
214-
end
215-
catch
216-
warning('java-based compression is not supported');
217-
end
218-
end
219-
opt.Compression = dozip;
220207
end
221208

222209
rootisarray = 0;

0 commit comments

Comments
 (0)