···11+ISC License
22+33+Copyright (c) 2025 Anil Madhavapeddy <anil@recoil.org>
44+55+Permission to use, copy, modify, and distribute this software for any
66+purpose with or without fee is hereby granted, provided that the above
77+copyright notice and this permission notice appear in all copies.
88+99+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
1010+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
1111+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
1212+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
1313+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
1414+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
1515+OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+57
README.md
···11+# bytesrw-eio - Bytesrw adapters for Eio
22+33+This library provides adapters to create `Bytesrw.Bytes.Reader.t` and `Bytesrw.Bytes.Writer.t` from Eio flows, mirroring the API of `Bytesrw_unix` for Eio's effect-based I/O.
44+55+## Key Features
66+77+- **Direct flow integration**: Read and write directly to Eio flows without intermediate buffering
88+- **Efficient I/O**: Allows Bytesrw to handle its own buffering strategy
99+- **Simple API**: Minimal, straightforward interface matching Bytesrw_unix patterns
1010+1111+## Usage
1212+1313+```ocaml
1414+open Eio.Std
1515+1616+(* Create a reader from an Eio flow *)
1717+let read_from_flow flow =
1818+ let reader = Bytesrw_eio.bytes_reader_of_flow flow in
1919+ (* Use reader with Bytesrw decoders *)
2020+ reader
2121+2222+(* Create a writer to an Eio flow *)
2323+let write_to_flow flow =
2424+ let writer = Bytesrw_eio.bytes_writer_of_flow flow in
2525+ (* Use writer with Bytesrw encoders *)
2626+ writer
2727+```
2828+2929+For custom slice sizes:
3030+3131+```ocaml
3232+(* Specify custom slice length for reading *)
3333+let reader = Bytesrw_eio.bytes_reader_of_flow ~slice_length:4096 flow in
3434+3535+(* Specify custom slice length for writing *)
3636+let writer = Bytesrw_eio.bytes_writer_of_flow ~slice_length:4096 flow in
3737+()
3838+```
3939+4040+## Installation
4141+4242+```
4343+opam install bytesrw-eio
4444+```
4545+4646+## Documentation
4747+4848+API documentation is available via:
4949+5050+```
5151+opam install bytesrw-eio
5252+odig doc bytesrw-eio
5353+```
5454+5555+## License
5656+5757+ISC
+5
bytesrw-eio.opam
···33synopsis: "Bytesrw readers and writers for Eio"
44description:
55 "Provides Bytesrw.Bytes.Reader and Writer adapters for Eio Flows"
66+maintainer: ["Anil Madhavapeddy <anil@recoil.org>"]
77+authors: ["Anil Madhavapeddy"]
88+license: "ISC"
99+homepage: "https://tangled.org/@anil.recoil.org/ocaml-bytesrw-eio"
1010+bug-reports: "https://tangled.org/@anil.recoil.org/ocaml-bytesrw-eio/issues"
611depends: [
712 "dune" {>= "3.18"}
813 "ocaml" {>= "5.0"}
···11(*---------------------------------------------------------------------------
22- Copyright (c) 2025 Anil Madhavapeddy. All rights reserved.
33- SPDX-License-Identifier: ISC
44- ---------------------------------------------------------------------------*)
22+ Copyright (c) 2025 Anil Madhavapeddy <anil@recoil.org>. All rights reserved.
33+ SPDX-License-Identifier: ISC
44+ ---------------------------------------------------------------------------*)
5566(** Bytesrw adapters for Eio
77
+5
src/bytesrw_eio.mli
···11+(*---------------------------------------------------------------------------
22+ Copyright (c) 2025 Anil Madhavapeddy <anil@recoil.org>. All rights reserved.
33+ SPDX-License-Identifier: ISC
44+ ---------------------------------------------------------------------------*)
55+16(** Bytesrw adapters for Eio
2738 This module provides adapters to create {!Bytesrw.Bytes.Reader.t} and