IKVM11  11
Java SE 11 Virtual Machine for .NET
Loading...
Searching...
No Matches
StreamWrapper.cs
Go to the documentation of this file.
1using System;
2using System.Collections;
3using System.Collections.Generic;
4
5using java.util.stream;
6
7namespace java.util.function
8{
9
14 struct StreamWrapper<T> : IEnumerable<T>
15 {
16
17 readonly Stream _stream;
18
24 public StreamWrapper(Stream stream)
25 {
26 this._stream = stream ?? throw new ArgumentNullException(nameof(stream));
27 }
28
33 public IEnumerator<T> GetEnumerator()
34 {
35 return _stream.iterator().AsEnumerator<T>();
36 }
37
42 IEnumerator IEnumerable.GetEnumerator()
43 {
44 return GetEnumerator();
45 }
46
47 }
48
49}
Wraps a Stream to produce an IEnumerable<T>.
StreamWrapper(Stream stream)
Initializes a new instance.
IEnumerator< T > GetEnumerator()
Gets an enumerator for the stream.