I thought I tried to contribute this months ago but I can't find the orig post - no problem - I'd just be happy to see it get in. And yes, there was the same discussion about ctr vs. helper method.
-----Original Message----- From: Otis Gospodnetic [mailto:otis_gospodnetic@;yahoo.com] Sent: Thursday, October 17, 2002 12:00 PM To: Lucene Developers List Subject: RE: Converting a Directory to a RAMDirectory Yes, I forgot to list that option. Btw. this all sounds very familiar. I thought somebody (from France?) has already contributed this months ago. Otis --- Eric Isakson <[EMAIL PROTECTED]> wrote: > Why not add this code to a RAMDirectory constructor like: > > public RAMDirectory(Directory d) throws IOException { > this(); > final String[] ar = d.list(); > for (int i = 0; i < ar.length; i++) { > // make place on ram disk > OutputStream os = createFile(ar[i]); > // read current file > InputStream is = d.openFile(ar[i]); > // and copy to ram disk > int len = (int) is.length(); > byte[] buf = new byte[len]; > is.readBytes(buf, 0, len); > os.writeBytes(buf, len); > // graceful cleanup > is.close(); > os.close(); > } > } > > -- > Eric D. Isakson SAS Institute Inc. > Application Developer SAS Campus Drive > XML Technologies Cary, NC 27513 > (919) 531-3639 http://www.sas.com > > > -- > To unsubscribe, e-mail: > <mailto:lucene-dev-unsubscribe@;jakarta.apache.org> > For additional commands, e-mail: > <mailto:lucene-dev-help@;jakarta.apache.org> > __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com -- To unsubscribe, e-mail: <mailto:lucene-dev-unsubscribe@;jakarta.apache.org> For additional commands, e-mail: <mailto:lucene-dev-help@;jakarta.apache.org> -- To unsubscribe, e-mail: <mailto:lucene-dev-unsubscribe@;jakarta.apache.org> For additional commands, e-mail: <mailto:lucene-dev-help@;jakarta.apache.org>