public static void writeBytesCollection(DataOutput out,Collection<byte[]> bytes) throws IOException {
  if (bytes != null) {
    out.writeInt(bytes.size());
    for (    byte[] b : bytes)     writeByteArray(out,b);
  }
 else   out.writeInt(-1);
}

public static void writeBytesCollection ( DataOutput out , Collection < byte [ ] > bytes ) throws IOException { if ( bytes != null ) { out . writeInt ( bytes . size ( ) ) ; for ( byte [ ] b : bytes ) writeByteArray ( out , b ) ; } else out . writeInt ( - 1 ) ; }
writes collection of byte arrays to data output .
