public class RandomTempFile
extends java.io.File
RandomInputStream
,
Serialized FormModifier and Type | Field and Description |
---|---|
private boolean |
binaryData
Flag controlling whether binary or character data is used
|
private static long |
serialVersionUID |
private static java.lang.String |
TEMP_DIR
Java temp dir where all temp files will be created
|
Constructor and Description |
---|
RandomTempFile(java.io.File root,
java.lang.String filename,
long sizeInBytes) |
RandomTempFile(java.lang.String filename,
long sizeInBytes)
Creates, and fills, a temp file with the specified name and specified
size of random ASCII data.
|
RandomTempFile(java.lang.String filename,
long sizeInBytes,
boolean binaryData)
Creates, and fills, a temp file with the specified name and specified
size of random binary or character data.
|
Modifier and Type | Method and Description |
---|---|
void |
createFile(long sizeInBytes) |
canExecute, canRead, canWrite, compareTo, createNewFile, createTempFile, createTempFile, delete, deleteOnExit, equals, exists, getAbsoluteFile, getAbsolutePath, getCanonicalFile, getCanonicalPath, getFreeSpace, getName, getParent, getParentFile, getPath, getTotalSpace, getUsableSpace, hashCode, isAbsolute, isDirectory, isFile, isHidden, lastModified, length, list, list, listFiles, listFiles, listFiles, listRoots, mkdir, mkdirs, renameTo, setExecutable, setExecutable, setLastModified, setReadable, setReadable, setReadOnly, setWritable, setWritable, toPath, toString, toURI, toURL
private static final long serialVersionUID
private static final java.lang.String TEMP_DIR
private final boolean binaryData
public RandomTempFile(java.lang.String filename, long sizeInBytes) throws java.io.IOException
filename
- The name for the new temporary file, within the Java temp
directory as declared in the JRE's system properties.sizeInBytes
- The amount of random ASCII data, in bytes, for the new temp
file.java.io.IOException
- If any problems were encountered creating the new temp file.public RandomTempFile(java.lang.String filename, long sizeInBytes, boolean binaryData) throws java.io.IOException
filename
- The name for the new temporary file, within the Java temp
directory as declared in the JRE's system properties.sizeInBytes
- The amount of random ASCII data, in bytes, for the new temp
file.binaryData
- Whether to fill the file with binary or character data.java.io.IOException
- If any problems were encountered creating the new temp file.public RandomTempFile(java.io.File root, java.lang.String filename, long sizeInBytes) throws java.io.IOException
java.io.IOException