close stream for java, seems don't need to close for ios