@@ -31,6 +31,18 @@ public void testUnicodeAtEnd() throws Exception
31
31
assertEquals (o .get (0 ).textValue (), doc );
32
32
}
33
33
34
+ @ Test
35
+ public void testUnicodeAtEnd2 () throws Exception
36
+ {
37
+ String doc = buildTestString2 ();
38
+ JsonNode o = MAPPER .reader () //.with(schema)
39
+ .readTree (doc .getBytes (StandardCharsets .UTF_8 ));
40
+ assertNotNull (o );
41
+ assertTrue (o .isArray ());
42
+ assertEquals (1 , o .size ());
43
+ assertEquals (o .get (0 ).textValue (), doc );
44
+ }
45
+
34
46
@ Test
35
47
public void testUnicodeAtEndStream () throws Exception
36
48
{
@@ -43,6 +55,18 @@ public void testUnicodeAtEndStream() throws Exception
43
55
assertEquals (o .get (0 ).textValue (), doc );
44
56
}
45
57
58
+ @ Test
59
+ public void testUnicodeAtEndStream2 () throws Exception
60
+ {
61
+ String doc = buildTestString2 ();
62
+ JsonNode o = MAPPER .reader () //.with(schema)
63
+ .readTree (new ByteArrayInputStream (doc .getBytes (StandardCharsets .UTF_8 )));
64
+ assertNotNull (o );
65
+ assertTrue (o .isArray ());
66
+ assertEquals (1 , o .size ());
67
+ assertEquals (o .get (0 ).textValue (), doc );
68
+ }
69
+
46
70
private static String buildTestString () {
47
71
StringBuilder sb = new StringBuilder (4001 );
48
72
for (int i = 0 ; i < 4000 ; ++i ) {
@@ -51,4 +75,14 @@ private static String buildTestString() {
51
75
sb .append ('\u5496' );
52
76
return sb .toString ();
53
77
}
78
+
79
+ private static String buildTestString2 () {
80
+ StringBuilder sb = new StringBuilder (4001 );
81
+ for (int i = 0 ; i < 3999 ; ++i ) {
82
+ sb .append ('a' );
83
+ }
84
+ sb .append ('\u5496' );
85
+ sb .append ('b' );
86
+ return sb .toString ();
87
+ }
54
88
}
0 commit comments