java
java copied to clipboard
[WIP] Fully-functional Slices
Slices may be always used instead of Strings. They can be read fast way, when there are no multibyte chars or escape sequences, or slow way, with String allocation.
Not done yet: String deduplication (less allocations), especially when parsing big lists of objects with similar structure.
slice is good when the input is byte array, and there is not unicode or escape. when the input is a input stream, the allocation can not be avoided.
In your variant reading slices may not succeed. For example, enum decoder reads a Slice without any fallback. But enum constant may contain non-unicode characters, while, for instance, PHP's json_encode function encodes such characters using \uXXXX.
Very strange. Tests, failing on Travis, are working correctly on my computer. Except ones with Streaming Category which failing on enableStreamingSupport with Javassist errors.