public static void writeString ( String string , ByteBuffer buffer ) throws IOException { if ( string == null ) { buffer . putInt ( VoltType . NULL_STRING_LENGTH ) ; return ; } byte [ ] strbytes = string . getBytes ( Constants . UTF8ENCODING ) ; int len = strbytes . length ; buffer . putInt ( len ) ; buffer . put ( strbytes ) ; }
Write a string in the standard VoltDB way without wrapping the byte buffer .