sample codes for efficient io