protected void writeByteArray ( ObjectOutput output , byte [ ] data ) throws IOException { if ( null == data || 0 == data . length ) { output . writeInt ( - 1 ) ; } else { output . writeInt ( data . length ) ; output . write ( data ) ; } }
Write information for the input data to the output stream . If the input data is null or empty this will write a - 1 length marker .