@@ -157,18 +157,20 @@ public void _testUtf8StringTrivial(int mode) throws Exception
157
157
158
158
public void testUtf8StringValue () throws Exception
159
159
{
160
- _testUtf8StringValue (MODE_INPUT_STREAM );
161
- _testUtf8StringValue (MODE_DATA_INPUT );
162
- _testUtf8StringValue (MODE_INPUT_STREAM_THROTTLED );
160
+ _testUtf8StringValue (MODE_INPUT_STREAM , 2900 );
161
+ _testUtf8StringValue (MODE_DATA_INPUT , 2900 );
162
+ _testUtf8StringValue (MODE_INPUT_STREAM_THROTTLED , 2900 );
163
+
164
+ _testUtf8StringValue (MODE_INPUT_STREAM , 5300 );
165
+ _testUtf8StringValue (MODE_DATA_INPUT , 5300 );
166
+ _testUtf8StringValue (MODE_INPUT_STREAM_THROTTLED , 5300 );
163
167
}
164
168
165
- public void _testUtf8StringValue (int mode ) throws Exception
169
+ public void _testUtf8StringValue (int mode , int len ) throws Exception
166
170
{
167
171
Random r = new Random (13 );
168
- //int LEN = 72000;
169
- int LEN = 720 ;
170
- StringBuilder sb = new StringBuilder (LEN + 20 );
171
- while (sb .length () < LEN ) {
172
+ StringBuilder sb = new StringBuilder (len + 20 );
173
+ while (sb .length () < len ) {
172
174
int c ;
173
175
if (r .nextBoolean ()) { // ascii
174
176
c = 32 + (r .nextInt () & 0x3F );
@@ -188,7 +190,7 @@ public void _testUtf8StringValue(int mode) throws Exception
188
190
sb .append ((char ) c );
189
191
}
190
192
191
- ByteArrayOutputStream bout = new ByteArrayOutputStream (LEN );
193
+ ByteArrayOutputStream bout = new ByteArrayOutputStream (len + ( len >> 2 ) );
192
194
OutputStreamWriter out = new OutputStreamWriter (bout , "UTF-8" );
193
195
out .write ("[\" " );
194
196
String VALUE = sb .toString ();
0 commit comments