diff --git a/core/CCIO.ml b/core/CCIO.ml index dae3d656..61f64cbb 100644 --- a/core/CCIO.ml +++ b/core/CCIO.ml @@ -116,8 +116,8 @@ let read_lines_l ic = with End_of_file -> List.rev !l -let read_all ic = - let buf = ref (Bytes.create 256) in +let read_all ?(size=1024) ic = + let buf = ref (Bytes.create size) in let len = ref 0 in try while true do diff --git a/core/CCIO.mli b/core/CCIO.mli index 80699140..73c1529e 100644 --- a/core/CCIO.mli +++ b/core/CCIO.mli @@ -83,8 +83,9 @@ val read_lines : in_channel -> string gen val read_lines_l : in_channel -> string list (** Read all lines into a list *) -val read_all : in_channel -> string -(** Read the whole channel into a buffer, then converted into a string *) +val read_all : ?size:int -> in_channel -> string +(** Read the whole channel into a buffer, then converted into a string. + @param size the internal buffer size @since NEXT_RELEASE *) (** {6 Output} *)