Skip to content

Commit

Permalink
Add input argument validation to fromFile and fromBytes.
Browse files Browse the repository at this point in the history
  • Loading branch information
kevingurney committed Jan 15, 2025
1 parent 555629e commit abdc67d
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions matlab/src/matlab/+arrow/+io/+ipc/RecordBatchStreamReader.m
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,24 @@

methods (Static)
function obj = fromBytes(bytes)
arguments
bytes(:, 1) uint8
end
args = struct(Bytes=bytes, Type="Bytes");
proxyName = "arrow.io.ipc.proxy.RecordBatchStreamReader";
proxy = arrow.internal.proxy.create(proxyName, args);
obj = arrow.io.ipc.RecordBatchStreamReader(proxy);
end
end

function obj = fromFile(filename)
arguments
filename(1, 1) string {mustBeNonzeroLengthText}
end
args = struct(Filename=filename, Type="File");
proxyName = "arrow.io.ipc.proxy.RecordBatchStreamReader";
proxy = arrow.internal.proxy.create(proxyName, args);
obj = arrow.io.ipc.RecordBatchStreamReader(proxy);
end
end
end

methods
Expand Down

0 comments on commit abdc67d

Please sign in to comment.