Code example for RandomAccessFile

Methods: close, seek, writeInt

0
		createRandomAccessFile(file);
		 
		try { 
			// Write size to RIFF header. 
			// 
			randomAccessWriter.seek(4);
			randomAccessWriter.writeInt(
					Integer.reverseBytes(36 + payloadSize));
 
			// Write size to Sub-chunk size header. 
			// 
			randomAccessWriter.seek(40);
			randomAccessWriter.writeInt(Integer.reverseBytes(payloadSize));
 
			randomAccessWriter.close();
		} catch (IOException e) {
			Log.e(PCMFile.class.getName(),
					"I/O exception occured while closing output file"); 
		} 
	}