Skip to content

Commit 7d76b8e

Browse files
committed
Add readBytes helper method.
1 parent 6190e4b commit 7d76b8e

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

Diff for: matlab/test/arrow/io/ipc/tRecordBatchStreamReader.m

+10-3
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@
3030
end
3131

3232
methods (Static)
33-
% Read the given file into memory as an array of bytes (uint8)
34-
% and then construct a RecordBatchStreamReader from the bytes.
35-
function reader = FromBytes(filename)
33+
34+
% Read the given file into memory as an array of bytes (uint8).
35+
function bytes = readBytes(filename)
3636
if ismissing(filename)
3737
% Simulate the behavior of fromFile when a filename
3838
% that is a missing string value is supplied.
@@ -47,8 +47,15 @@
4747
error(message("MATLAB:validators:mustBeNonzeroLengthText", ""))
4848
end
4949
fclose(fid);
50+
end
51+
52+
% Read the given file into memory as bytes and then construct a
53+
% RecordBatchStreamReader from the bytes.
54+
function reader = FromBytes(filename)
55+
bytes = tRecordBatchStreamReader.readBytes(filename);
5056
reader = arrow.io.ipc.RecordBatchStreamReader.fromBytes(bytes);
5157
end
58+
5259
end
5360

5461
methods(TestClassSetup)

0 commit comments

Comments
 (0)