Code example for RandomAccessFile

Methods: getFD

0
				if (listener != null)
					listener.notifyOfDiskHit();
				if (raFile == null) {
					tempFile = File.createTempFile(QueueBuilder.class.getName(), ".tmp");
					// don't keep opening and closing file objects 
					raFile = new RandomAccessFile(tempFile, "rw");
					output =
						new ObjectOutputStream(new BufferedOutputStream(new FileOutputStream(
								raFile.getFD()), BUFFER_SIZE));
				} 
			} 
 
			diskObjectCount++;
			output.writeObject(obj);
		} 
	} 
 
	public Iterable<T> reread() throws IOException {
		if (disposed) {
			throw new IllegalStateException("Queue is disposed");
		}