Class StreamTokenStream
An ITokenStream<TToken> implementation based on a Stream.
Inheritance
- Object
- StreamTokenStream
Implements
Declaration
public class StreamTokenStream : Object, ITokenStream<byte>
Constructors
StreamTokenStream(Stream)
Creates an ITokenStream<TToken> implementation based on a Stream.
Declaration
public StreamTokenStream(Stream input)
Parameters
Type | Name | Description |
---|---|---|
input |
The Stream. |
Properties
ChunkSizeHint
Returns 4096.
Declaration
public int ChunkSizeHint { get; }
Property Value
Type | Description |
---|---|
4096 |
Methods
Read(Span<Byte>)
Read up to buffer.Length
tokens into buffer
.
Return the actual number of tokens read, which may be fewer than
the size of the buffer if the stream has reached the end.
Declaration
public int Read(Span<byte> buffer)
Parameters
Type | Name | Description |
---|---|---|
buffer |
The buffer to read tokens into. |
Returns
Type | Description |
---|---|
The actual number of tokens read. |