Class FileIO
java.lang.Object
jcuda.utils.FileIO
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
readFileAsString
(String filename) Read the contents of the file with the given name, and return it as a Stringstatic byte[]
readFileByte
(String filename) Reads the file with the given name containing byte data, and returns the contents of this file as an arraystatic double[]
readFileDouble
(String filename) Reads the file with the given name containing double precision floating point data, and returns the contents of this file as an arraystatic float[]
readFileFloat
(String filename) Reads the file with the given name containing single precision floating point data, and returns the contents of this file as an arraystatic int[]
readFileInt
(String filename) Reads the file with the given name containing integer data, and returns the contents of this file as an arraystatic void
Writes the given array into a file with the given name.static void
Writes the given array into a file with the given name.static void
Writes the given array into a file with the given name.static void
Writes the given array into a file with the given name.
-
Method Details
-
readFileFloat
Reads the file with the given name containing single precision floating point data, and returns the contents of this file as an array- Parameters:
filename
- The name of the file- Returns:
- The contents of the file
- Throws:
jcuda.CudaException
- if the file could not be read
-
readFileDouble
Reads the file with the given name containing double precision floating point data, and returns the contents of this file as an array- Parameters:
filename
- The name of the file- Returns:
- The contents of the file
- Throws:
jcuda.CudaException
- if the file could not be read
-
readFileInt
Reads the file with the given name containing integer data, and returns the contents of this file as an array- Parameters:
filename
- The name of the file- Returns:
- The contents of the file
- Throws:
jcuda.CudaException
- if the file could not be read
-
readFileByte
Reads the file with the given name containing byte data, and returns the contents of this file as an array- Parameters:
filename
- The name of the file- Returns:
- The contents of the file
- Throws:
jcuda.CudaException
- if the file could not be read
-
writeFile
Writes the given array into a file with the given name.- Parameters:
filename
- The name of the filedata
- The data to writeepsilon
- Epsilon for comparison- Throws:
jcuda.CudaException
- if the file could not be written
-
writeFile
Writes the given array into a file with the given name.- Parameters:
filename
- The name of the filedata
- The data to writeepsilon
- Epsilon for comparison- Throws:
jcuda.CudaException
- if the file could not be written
-
writeFile
Writes the given array into a file with the given name.- Parameters:
filename
- The name of the filedata
- The data to write- Throws:
jcuda.CudaException
- if the file could not be written
-
writeFile
Writes the given array into a file with the given name.- Parameters:
filename
- The name of the filedata
- The data to write- Throws:
jcuda.CudaException
- if the file could not be written
-
readFileAsString
-