Code example for RandomAccessFile

Methods: close, seek, write

0
			if (SDStateString.equals(android.os.Environment.MEDIA_MOUNTED)
					&& bytes.length < getSDAvailableSize()) {
				File file = null;
				creatSDDir(dir);
				file = createFileInSDCard(dir, fileName);
				raFile = new RandomAccessFile(file, "rwd");
				raFile.seek(offset);
				raFile.write(bytes);
				return true; 
			} 
		} catch (IOException e) {
			e.printStackTrace();
		} finally { 
			try { 
				raFile.close();
			} catch (IOException e) {
				// TODO Auto-generated catch block 
				e.printStackTrace();
			} 
		} 
		return false;