void writeString ( String value ) throws IOException { byte [ ] bytes = toUTF8 ( value ) ; int size = bytes . length ; if ( size < 32 ) { output . writeByte ( MIN_FIX_STR + size ) ; } else if ( size < 256 ) { output . writeByte ( STR_8 ) ; output . writeByte ( size ) ; } else if ( size < 65536 ) { output . writeByte ( STR_16 ) ; output . writeShort ( size ) ; } else { output . writeByte ( STR_32 ) ; output . writeInt ( size ) ; } output . write ( bytes ) ; }
Writes a MessagePack string .