Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

a quick fix to save binary data properly #1

Open
ekim7809 opened this issue Jun 20, 2017 · 1 comment
Open

a quick fix to save binary data properly #1

ekim7809 opened this issue Jun 20, 2017 · 1 comment

Comments

@ekim7809
Copy link

In extending protocol of ByteConversion, objects other than strings should not get converted to strings with str function then get the bytes out of those.

In my case, I needed to insert binary data of bytes or bytes-arrays that I get from UUID objects. Data type I set in schema is "binary". Converting bytes to a string actually gives you a string of reference address like "[B@5ee34b1b" which will always get saved as 11 bytes long binary data and the first 3 bytes will always be the same :)

Quick fix:

Object
#_(to-bytes [o] (to-bytes (str o)))
(to-bytes [o] o))

Thank you for sharing, Ben.

@bpoweski
Copy link
Owner

bpoweski commented Apr 6, 2018

Thanks, I completely missed this notification.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants