public class

GridFSDBFile

extends GridFSFile
java.lang.Object
   ↳ com.mongodb.gridfs.GridFSFile
     ↳ com.mongodb.gridfs.GridFSDBFile

Class Overview

This class enables to retrieve a GridFS file metadata and content. Operations include: - writing data to a file on disk or an OutputStream - getting each chunk as a byte array - getting an InputStream to stream the data into

Summary

[Expand]
Inherited Fields
From class com.mongodb.gridfs.GridFSFile
Public Constructors
GridFSDBFile()
Public Methods
InputStream getInputStream()
Returns an InputStream from which data can be read
long writeTo(String filename)
Writes the file's data to a file on disk@return
long writeTo(OutputStream out)
Writes the file's data to an OutputStream@return
long writeTo(File f)
Writes the file's data to a file on disk@return
[Expand]
Inherited Methods
From class com.mongodb.gridfs.GridFSFile
From class java.lang.Object
From interface com.mongodb.DBObject
From interface org.bson.BSONObject

Public Constructors

public GridFSDBFile ()

Public Methods

public InputStream getInputStream ()

Returns an InputStream from which data can be read

public long writeTo (String filename)

Writes the file's data to a file on disk@return

Parameters
filename the file name on disk
Throws
IOException

public long writeTo (OutputStream out)

Writes the file's data to an OutputStream@return

Parameters
out the OutputStream
Throws
IOException

public long writeTo (File f)

Writes the file's data to a file on disk@return

Parameters
f the File object
Throws
IOException