On Thursday, June 25, 2015 at 12:09:47 PM UTC+10, andrew cooke wrote:
>
>
> Oh, I think they're both subtypes of IO and I probably only need IO 
> methods.
>
> On Wednesday, 24 June 2015 22:04:47 UTC-3, andrew cooke wrote:
>>
>> I'm trying to test and document some routines that process files.  Is 
>> there a simple way to create an IOStream from a string?
>>
>> From the docs I thought IOBuffer(string) would do it, but despite what 
>> the docs say ("an in-memory I/O stream") an IOBuffer is not an IOStream.
>>
>
Works for me (0.3.8):

julia> readall(IOBuffer("abc"))
"abc"

Note that the stream is probably text, not binary, so binary IO is likely 
to have unexpected results:

julia> read(IOBuffer("12345678"), Int)
4050765991979987505

Cheers
Lex
 

>
>> Thanks,
>> Andrew
>>
>

Reply via email to