@@ -643,7 +643,7 @@ public void writeBoolean (boolean value) throws KryoException {
643643 }
644644
645645 // String:
646-
646+
647647 /** Writes the length and string, or null. Short strings are checked and if ASCII they are written more efficiently, else they
648648 * are written as UTF8. If a string is known to be ASCII, {@link #writeAscii(String)} may be used. The string can be read using
649649 * {@link Input#readString()} or {@link Input#readStringBuilder()}.
@@ -663,8 +663,6 @@ public void writeString (String value) throws KryoException {
663663 if (charCount > 1 && charCount <= 32 ) {
664664 for (int i = 0 ; i < charCount ; i ++)
665665 if (value .charAt (i ) > 127 ) break outer ;
666-
667- // todo can combine
668666 if (capacity - position < charCount )
669667 writeAscii_slow (value , charCount );
670668 else {
@@ -694,7 +692,7 @@ public void writeString (String value) throws KryoException {
694692 }
695693 if (charIndex < charCount ) writeUtf8_slow (value , charCount , charIndex );
696694 }
697-
695+
698696 /** Writes a string that is known to contain only ASCII characters. Non-ASCII strings passed to this method will be corrupted.
699697 * Each byte is a 7 bit character with the remaining byte denoting if another character is available. This is slightly more
700698 * efficient than {@link #writeString(String)}. The string can be read using {@link Input#readString()} or
@@ -743,7 +741,7 @@ else if (c > 0x07FF) {
743741 }
744742 }
745743 }
746-
744+
747745 private void writeAscii_slow (String value , int charCount ) throws KryoException {
748746 if (charCount == 0 ) return ;
749747 if (position == capacity ) require (1 ); // Must be able to write at least one character.
@@ -758,7 +756,9 @@ private void writeAscii_slow (String value, int charCount) throws KryoException
758756 if (require (charsToWrite )) buffer = this .buffer ;
759757 }
760758 }
761-
759+
760+ // Primitive arrays:
761+
762762 /** Writes an int array in bulk. This may be more efficient than writing them individually. */
763763 public void writeInts (int [] array , int offset , int count ) throws KryoException {
764764 if (capacity >= count << 2 ) {
0 commit comments