some utility functions writed by Java