# How to subset a stream I/O and pass it to TensorFlow.jl? (question has been updated)

**URL:** https://discourse.julialang.org/t/how-to-subset-a-stream-i-o-and-pass-it-to-tensorflow-jl-question-has-been-updated/3502
**Category:** Data
**Tags:** question
**Created:** [May 3, 2017, 4:30pm UTC](https://discourse.julialang.org/t/how-to-subset-a-stream-i-o-and-pass-it-to-tensorflow-jl-question-has-been-updated/3502 "2017-05-03T16:30:48Z")
**Posts on this page:** 1
**Showing post:** 37

<div class="post-metadata">

### Author: ![joshbode](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/joshbode/32/260_2.png) [@joshbode](https://discourse.julialang.org/u/joshbode)
#### Post date: [May 4, 2017, 8:10pm UTC](https://discourse.julialang.org/t/how-to-subset-a-stream-i-o-and-pass-it-to-tensorflow-jl-question-has-been-updated/3502/37 "2017-05-04T20:10:05Z")

</div>

Sorry, the `nb_available` for the Libz stream should have been `!eof`:

```julia
if !method_exists(nb_available, (BufferedStreams.BufferedInputStream{Libz.Source}, ))
    Base.nb_available{T <: Libz.Source}(s::BufferedStreams.BufferedInputStream{T}) = !eof(s)
end

```

It is only required to let `CSV.Source` know (once, at the start) that it can start on the stream and that it isn’t empty or already exhausted.

The `method_exists` check should make it a little bit more future-proof, in case an official method is later added.

---

_[View the full topic](https://discourse.julialang.org/t/how-to-subset-a-stream-i-o-and-pass-it-to-tensorflow-jl-question-has-been-updated/3502)._
