public class ScratchFile extends Object implements Closeable
ScratchFile instance, and is deleted when the ScratchFile is closed.
Multiple buffers can be creating by calling the createBuffer() method.
The file is split into pages, each page containing a pointer to the previous and next pages. This allows for multiple, separate streams in the same file.
| Constructor and Description |
|---|
ScratchFile(File scratchFileDirectory)
Creates a new scratch file.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes and deletes the temporary file.
|
RandomAccess |
createBuffer()
Creates a new buffer in the scratch file.
|
public ScratchFile(File scratchFileDirectory) throws IOException
scratchFileDirectory - The directory in which to create the scratch file, or {code null} if the scratch
should be created in the default temporary directory.IOException - If there was a problem creating a temporary file.public RandomAccess createBuffer() throws IOException
IOException - If an error occurred.public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOException - If there was a problem closing or deleting the temporary file.Copyright © 2015–2021 The veraPDF Consortium. All rights reserved.