Package org.nd4j.common.loader
Class FileBatch
- java.lang.Object
-
- org.nd4j.common.loader.FileBatch
-
- All Implemented Interfaces:
Serializable
public class FileBatch extends Object implements Serializable
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static String
ORIGINAL_PATHS_FILENAME
Name of the file in the zip file that contains the original paths/filenames
-
Constructor Summary
Constructors Constructor Description FileBatch()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static FileBatch
forFiles(File... files)
Create a FileBatch from the specified filesstatic FileBatch
forFiles(List<File> files)
Create a FileBatch from the specified filesstatic FileBatch
readFromZip(File file)
Read a FileBatch from the specified file.static FileBatch
readFromZip(InputStream is)
Read a FileBatch from the specified input stream.void
writeAsZip(File f)
Write the FileBatch to the specified File, in zip file formatvoid
writeAsZip(OutputStream os)
-
-
-
Field Detail
-
ORIGINAL_PATHS_FILENAME
public static final String ORIGINAL_PATHS_FILENAME
Name of the file in the zip file that contains the original paths/filenames- See Also:
- Constant Field Values
-
-
Method Detail
-
readFromZip
public static FileBatch readFromZip(File file) throws IOException
Read a FileBatch from the specified file. This method assumes the FileBatch was previously saved to zip format usingwriteAsZip(File)
orwriteAsZip(OutputStream)
- Parameters:
file
- File to read from- Returns:
- The loaded FileBatch
- Throws:
IOException
- If an error occurs during reading
-
readFromZip
public static FileBatch readFromZip(InputStream is) throws IOException
Read a FileBatch from the specified input stream. This method assumes the FileBatch was previously saved to zip format usingwriteAsZip(File)
orwriteAsZip(OutputStream)
- Parameters:
is
- Input stream to read from- Returns:
- The loaded FileBatch
- Throws:
IOException
- If an error occurs during reading
-
forFiles
public static FileBatch forFiles(File... files) throws IOException
Create a FileBatch from the specified files- Parameters:
files
- Files to create the FileBatch from- Returns:
- The created FileBatch
- Throws:
IOException
- If an error occurs during reading of the file content
-
forFiles
public static FileBatch forFiles(List<File> files) throws IOException
Create a FileBatch from the specified files- Parameters:
files
- Files to create the FileBatch from- Returns:
- The created FileBatch
- Throws:
IOException
- If an error occurs during reading of the file content
-
writeAsZip
public void writeAsZip(File f) throws IOException
Write the FileBatch to the specified File, in zip file format- Parameters:
f
- File to write to- Throws:
IOException
- If an error occurs during writing
-
writeAsZip
public void writeAsZip(OutputStream os) throws IOException
- Parameters:
os
- Write the FileBatch to the specified output stream, in zip file format- Throws:
IOException
- If an error occurs during writing
-
-