¡@

Home 

java Programming Glossary: raf

Problem with Java file locking mechanism (FileLock etc)

http://stackoverflow.com/questions/2479222/problem-with-java-file-locking-mechanism-filelock-etc

readFile File xmlFile new File myFile.xml RandomAccessFile raf new RandomAccessFile xmlFile rw FileLock fl raf.getChannel .tryLock.. raf new RandomAccessFile xmlFile rw FileLock fl raf.getChannel .tryLock if fl null System.out.println file already.. already locked by another instance else setCurrentFile raf setLock fl System.out.println file successfully locked by this..

Create thumbnail image for PDF in Java

http://stackoverflow.com/questions/2844961/create-thumbnail-image-for-pdf-in-java

example page File file new File test.pdf RandomAccessFile raf new RandomAccessFile file r FileChannel channel raf.getChannel.. raf new RandomAccessFile file r FileChannel channel raf.getChannel ByteBuffer buf channel.map FileChannel.MapMode.READ_ONLY..

How to unmap a file from memory mapped using FileChannel in java?

http://stackoverflow.com/questions/2972986/how-to-unmap-a-file-from-memory-mapped-using-filechannel-in-java

section open File f new File sample.txt RandomAccessFile raf new RandomAccessFile f rw FileChannel fc raf.getChannel MappedByteBuffer.. raf new RandomAccessFile f rw FileChannel fc raf.getChannel MappedByteBuffer mbf fc.map FileChannel.MapMode.READ_ONLY.. fc.map FileChannel.MapMode.READ_ONLY 0 fc.size fc.close raf.close FileOutputStream fos new FileOutputStream f fos.write..

Convert PDF to thumbnail image in Java [closed]

http://stackoverflow.com/questions/4929813/convert-pdf-to-thumbnail-image-in-java

File pdfFile new File path to pdf.pdf RandomAccessFile raf new RandomAccessFile pdfFile r FileChannel channel raf.getChannel.. raf new RandomAccessFile pdfFile r FileChannel channel raf.getChannel ByteBuffer buf channel.map FileChannel.MapMode.READ_ONLY..

Export PDF pages to a series of images in Java

http://stackoverflow.com/questions/550129/export-pdf-pages-to-a-series-of-images-in-java

a byte buffer File file new File test.pdf RandomAccessFile raf new RandomAccessFile file r FileChannel channel raf.getChannel.. raf new RandomAccessFile file r FileChannel channel raf.getChannel ByteBuffer buf channel.map FileChannel.MapMode.READ_ONLY..

Java - delete line from text file by overwriting while reading it

http://stackoverflow.com/questions/6477762/java-delete-line-from-text-file-by-overwriting-while-reading-it

String f int toRemove throws IOException RandomAccessFile raf new RandomAccessFile f rw Leave the n first lines unchanged... the n first lines unchanged. for int i 0 i toRemove i raf.readLine Shift remaining lines upwards. long writePos raf.getFilePointer.. raf.readLine Shift remaining lines upwards. long writePos raf.getFilePointer raf.readLine long readPos raf.getFilePointer..

Efficient way of handling file pointers in Java? (Using BufferedReader with file pointer)

http://stackoverflow.com/questions/1575087/efficient-way-of-handling-file-pointers-in-java-using-bufferedreader-with-file

inefficient. If it's convenient for you to read from the RAF and do your own buffering to split the lines then there's nothing.. to split the lines then there's nothing wrong with RAF per se just that its readLine is poorly implemented share improve..

File Streaming in Java

http://stackoverflow.com/questions/4728523/file-streaming-in-java

they show a simple implementation of RandomAccessFile RAF with self buffering improvement. Mr. Gregory provides several.. between FileChannel ByteBuffer Mapping FBM and RAF. He says that he noticed 4x speedup when using FBM compared.. says that he noticed 4x speedup when using FBM compared to RAF. I have ran this benchmark in the following conditions The offset..