# How to serialize data directly to my custom IO?

**URL:** <https://discourse.julialang.org/t/how-to-serialize-data-directly-to-my-custom-io/99754>\
**Category:** General Usage\
**Created:** [June 2, 2023, 5:59am UTC](https://discourse.julialang.org/t/how-to-serialize-data-directly-to-my-custom-io/99754 "2023-06-02T05:59:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![andrey2185](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/andrey2185/32/9889_2.png) [@andrey2185](https://discourse.julialang.org/u/andrey2185)\
**Post date:** [June 2, 2023, 5:59am UTC](https://discourse.julialang.org/t/how-to-serialize-data-directly-to-my-custom-io/99754/1 "2023-06-02T05:59:15Z")

</div>

Hello, how to serialize data directly to my custom IO without using IOBuffer ?  
I just copy serialized data bytes from IOBuffer to custom IO object.

---

<div class="post-metadata">

**Author:** ![andrey2185](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/andrey2185/32/9889_2.png) [@andrey2185](https://discourse.julialang.org/u/andrey2185)\
**Post date:** [June 5, 2023, 10:55am UTC](https://discourse.julialang.org/t/how-to-serialize-data-directly-to-my-custom-io/99754/2 "2023-06-05T10:55:24Z")

</div>

seriously ? nobody tried it?

---

<div class="post-metadata">

**Author:** ![josuagrw](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/josuagrw/32/1015_2.png) [@josuagrw](https://discourse.julialang.org/u/josuagrw)\
**Post date:** [June 5, 2023, 11:03am UTC](https://discourse.julialang.org/t/how-to-serialize-data-directly-to-my-custom-io/99754/3 "2023-06-05T11:03:24Z")

</div>

I have not tried this but I would expect that you would need to implement methods for the functions that `IOBuffer` supports for your custom IO. Functions like `take!` and `write`.

You can use reflection to find all the functions of `IOBuffer`:

[https://docs.julialang.org/en/v1/stdlib/InteractiveUtils/#InteractiveUtils.methodswith](https://docs.julialang.org/en/v1/stdlib/InteractiveUtils/#InteractiveUtils.methodswith)
