Read .mat file from base64

Suppose I have the following based64 encoded .mat file:

using MAT
using Base64

mat_enc = open(base64encode, "01.mat")
mat_dec = base64decode(mat_enc)
open("my_01.mat", "w") do f
	write(f, mat_dec)
end
data = matread("mymat.mat")

Is it possible to read the contents of the decoded base64 directly, without writing the .mat file to disk?

The typical solution to this would be to wrap mat_dec in an IOBuffer.

But it looks like MAT only takes filenames as inputs to .matread, matopen - maybe could be enhanced to take an <: IO

2 Likes