MemoryStream now constructed in UTFDecoder.
This commit is contained in:
parent
e525ac120a
commit
c296a6e790
|
@ -102,7 +102,7 @@ final class Reader
|
||||||
}
|
}
|
||||||
|
|
||||||
version(unittest) { endian_ = result.endian; }
|
version(unittest) { endian_ = result.endian; }
|
||||||
decoder_ = UTFFastDecoder(new MemoryStream(result.array), result.encoding);
|
decoder_ = UTFFastDecoder(result.array, result.encoding);
|
||||||
}
|
}
|
||||||
|
|
||||||
@trusted nothrow @nogc ~this()
|
@trusted nothrow @nogc ~this()
|
||||||
|
@ -421,10 +421,10 @@ struct UTFBlockDecoder(size_t bufferSize_) if (bufferSize_ % 2 == 0)
|
||||||
dchar[] buffer_;
|
dchar[] buffer_;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/// Construct a UTFBlockDecoder decoding a stream.
|
/// Construct a UTFBlockDecoder decoding data from a buffer.
|
||||||
this(MemoryStream stream, UTFEncoding encoding) @trusted
|
this(ubyte[] buffer, UTFEncoding encoding) @trusted
|
||||||
{
|
{
|
||||||
stream_ = stream;
|
stream_ = new MemoryStream(buffer);
|
||||||
available_ = stream_.available;
|
available_ = stream_.available;
|
||||||
encoding_ = encoding;
|
encoding_ = encoding;
|
||||||
final switch(encoding_)
|
final switch(encoding_)
|
||||||
|
|
Loading…
Reference in a new issue