diff --git a/packages/rtl/classes.pas b/packages/rtl/classes.pas
index a6cdbab..1925662 100644
--- a/packages/rtl/classes.pas
+++ b/packages/rtl/classes.pas
@@ -1554,16 +1554,18 @@ Var
B : TBytes;
Buf : TJSArrayBuffer;
BytesLeft : Integer;
+ ByteCount : Integer;
begin
// Top off
+ ByteCount:=Count*2; // UTF-16
BytesLeft:=(Size-Position);
- if BytesLeft
-
+
diff --git a/test/testrtl.lpr b/test/testrtl.lpr
index 84fcde2..4d92f47 100644
--- a/test/testrtl.lpr
+++ b/test/testrtl.lpr
@@ -26,7 +26,7 @@ program testrtl;
uses
browserconsole, consoletestrunner, frmrtlrun, simplelinkedlist,
-// tcstream,
+ tcstream,
// tccompstreaming,
// tcsyshelpers,
// tcgenarrayhelper,