void write ( Writable value ) throws IOException { byte [ ] bval ; int valSize ; if ( value instanceof BytesWritable ) { BytesWritable val = ( BytesWritable ) value ; bval = val . get ( ) ; valSize = val . getSize ( ) ; } else if ( value instanceof Text ) { Text val = ( Text ) value ; bval = val . getBytes ( ) ; valSize = val . getLength ( ) ; } else { String sval = value . toString ( ) ; bval = sval . getBytes ( "UTF-8" ) ; valSize = bval . length ; } clientOut_ . write ( bval , 0 , valSize ) ; }
Write a writable value to the output stream using UTF - 8 encoding