julia icon indicating copy to clipboard operation
julia copied to clipboard

add single-argument (de)serialize methods operating on vectors of bytes

Open aplavin opened this issue 3 weeks ago • 1 comments

Basically, for convenience: I find myself copy-pasting these methods whenever I load/store Julia serialized data as part of another data format like parquet or sql database. They natively store byte arrays, and would be nice to have these (de)serialize methods going directly back and forth between Julia objects and byte vectors.

Another neat usecase is to quickly copy-paste a Julia object between different Julia sessions (repls, notebooks, remote, ...):

# in session 1:
x |> serialize |> base64encode
# copy the resulting string

# in session 2:
x = "<paste string here>" |> base64decode |> deserialize

aplavin avatar Dec 04 '25 20:12 aplavin

Looks good. Would be nice to add doc strings to these.

JeffBezanson avatar Dec 05 '25 20:12 JeffBezanson

I think we can just merge this. What is the mac build failure here about?

JeffBezanson avatar Dec 12 '25 19:12 JeffBezanson

is there a reason the docs enforce specifically a Vector{UInt8} from serialize rather than an iterator over UInt8 ? it's quite rare one needs indexed access to serialized data, right?

for deserialize it makes sense to not promise more than is implemented, but I don't think these need to be perfectly symmetric

adienes avatar Dec 12 '25 19:12 adienes