src/Pure/General/bytes.ML
changeset 75602 7a0d4c126f79
parent 75596 7ff9745609d7
child 75603 fc8d64a578e4
equal deleted inserted replaced
75597:e6e0a95f87f3 75602:7a0d4c126f79
   194       (case read_block (limit - length bytes) stream of
   194       (case read_block (limit - length bytes) stream of
   195         "" => bytes
   195         "" => bytes
   196       | s => read (add s bytes))
   196       | s => read (add s bytes))
   197   in read empty end;
   197   in read empty end;
   198 
   198 
   199 fun write_stream stream = File.outputs stream o contents;
   199 fun write_stream stream bytes =
   200 
   200   File.outputs stream (contents bytes);
   201 val read = File.open_input (read_stream ~1);
   201 
   202 val write = File.open_output write_stream;
   202 fun read path = File.open_input (fn stream => read_stream ~1 stream) path;
       
   203 
       
   204 fun write path bytes = File.open_output (fn stream => write_stream stream bytes) path;
   203 
   205 
   204 
   206 
   205 (* ML pretty printing *)
   207 (* ML pretty printing *)
   206 
   208 
   207 val _ =
   209 val _ =