How do I turn a JSON file into a Java 8 Object Stream?
<p>I have a very large &gt; 1GB JSON file containing an array (it's confidential, but this file of sleep duration data is a proxy:)</p>
<pre><code> [
        {
            &quot;date&quot;: &quot;August 17, 2015&quot;,
            &quot;hours&quot;: 7,
            &quot;minutes&quot;: 10
        },
        {
            &quot;date&quot;: &quot;August 19, 2015&quot;,
            &quot;hours&quot;: 4,
            &quot;minutes&quot;: 46
        },
        {
            &quot;date&quot;: &quot;August 19, 2015&quot;,
            &quot;hours&quot;: 7,
            &quot;minutes&quot;: 22
        },
        {
            &quot;date&quot;: &quot;August 21, 2015&quot;,
            &quot;hours&quot;: 4,
            &quot;minutes&quot;: 48
        },
        {
            &quot;date&quot;: &quot;August 21, 2015&quot;,
            &quot;hours&quot;: 6,
            &quot;minutes&quot;: 1
        }
    ]
</code></pre>
<p>I've used JSON2POJO to produce a &quot;Sleep&quot; object definition.</p>
<p>Now, one could use Jackson's Mapper to just convert to an array, and then use Arrays.stream(ARRAY). Except that this crashes (yes, it's a BIG file).</p>
<p>The obvious thing is to use Jackson's Streaming API. But that's super low level. In particular, I still want Sleep Objects.</p>
<p>How do I use the Jackson Streaming JSON reader and my Sleep.java class to generate a Java 8 Stream of Sleep Objects?</p>