Skip to content

Commit

Permalink
Add readBytes helper method.
Browse files Browse the repository at this point in the history
  • Loading branch information
kevingurney committed Jan 15, 2025
1 parent 6190e4b commit 7d76b8e
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions matlab/test/arrow/io/ipc/tRecordBatchStreamReader.m
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@
end

methods (Static)
% Read the given file into memory as an array of bytes (uint8)
% and then construct a RecordBatchStreamReader from the bytes.
function reader = FromBytes(filename)

% Read the given file into memory as an array of bytes (uint8).
function bytes = readBytes(filename)
if ismissing(filename)
% Simulate the behavior of fromFile when a filename
% that is a missing string value is supplied.
Expand All @@ -47,8 +47,15 @@
error(message("MATLAB:validators:mustBeNonzeroLengthText", ""))
end
fclose(fid);
end

% Read the given file into memory as bytes and then construct a
% RecordBatchStreamReader from the bytes.
function reader = FromBytes(filename)
bytes = tRecordBatchStreamReader.readBytes(filename);
reader = arrow.io.ipc.RecordBatchStreamReader.fromBytes(bytes);
end

end

methods(TestClassSetup)
Expand Down

0 comments on commit 7d76b8e

Please sign in to comment.