File tree Expand file tree Collapse file tree 1 file changed +0
-47
lines changed
src/main/java/com/arangodb/velocypack Expand file tree Collapse file tree 1 file changed +0
-47
lines changed Original file line number Diff line number Diff line change @@ -623,53 +623,6 @@ private void appendSQLTimestamp(final Timestamp value) {
623
623
}
624
624
625
625
private void appendString (final String value ) throws VPackBuilderException {
626
- int tagPos = size ;
627
- int strLen = value .length ();
628
-
629
- // Guess whether the end result will be short or long. Assume ASCII for now.
630
- int tagSizeLen = strLen <= 126 ? 1 : 9 ;
631
-
632
- // Fast path. Assume ASCII.
633
- ensureCapacity (size + tagSizeLen + strLen );
634
-
635
- // Reserve space for the tag + length.
636
- size += tagSizeLen ;
637
-
638
- // Fast+tight loop for ASCII-only, no-escaping-needed output
639
- // Implementation lifted from jackson's UTF8JsonGenerator.
640
- int [] escCodes = CharTypes .get7BitOutputEscapes ();
641
- int offset = 0 ;
642
- while (offset < strLen ) {
643
- int ch = value .charAt (offset );
644
- if (ch > 0x7F || escCodes [ch ] != 0 ) {
645
- break ; // Not ASCII.
646
- }
647
- buffer [size ++] = (byte ) ch ;
648
- ++offset ;
649
- }
650
-
651
- if (offset < strLen ) {
652
- // Not ASCII. Rewind and do the slow path.
653
- size = tagPos ;
654
- appendUtf8String (value );
655
- return ;
656
- }
657
-
658
- // ASCII. strLen == bytes len.
659
- // Rewind size temporarily to write the header before the string data.
660
- size = tagPos ;
661
- if (strLen <= 126 ) {
662
- // short string
663
- add ((byte ) (0x40 + strLen ));
664
- } else {
665
- // long string
666
- add ((byte ) 0xbf );
667
- appendLength (strLen );
668
- }
669
- size += strLen ;
670
- }
671
-
672
- private void appendUtf8String (String value ) {
673
626
final byte [] bytes = value .getBytes (StandardCharsets .UTF_8 );
674
627
final int length = bytes .length ;
675
628
if (length <= 126 ) {
You can’t perform that action at this time.
0 commit comments