|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.pivot.io.FileSerializer
public class FileSerializer
Implementation of the Serializer
interface that reads and
writes File
objects.
Field Summary | |
---|---|
static int |
BUFFER_SIZE
|
Constructor Summary | |
---|---|
FileSerializer()
Creates a new file serializer that will store temporary files in the default temporary file directory. |
|
FileSerializer(File tempFileDirectory)
Creates a new file serializer that will store temporary files in a specific directory. |
Method Summary | |
---|---|
String |
getMIMEType(File file)
Returns the MIME type of the data read and written by this serializer. |
File |
readObject(InputStream inputStream)
Reads a file from an input stream. |
void |
writeObject(File file,
OutputStream outputStream)
Writes a file to an output stream. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int BUFFER_SIZE
Constructor Detail |
---|
public FileSerializer()
public FileSerializer(File tempFileDirectory)
tempFileDirectory
- The directory in which to store temporary folders.Method Detail |
---|
public File readObject(InputStream inputStream) throws IOException, SerializationException
readObject
in interface Serializer<File>
inputStream
- The data stream from which the object will be read.
IOException
SerializationException
public void writeObject(File file, OutputStream outputStream) throws IOException, SerializationException
writeObject
in interface Serializer<File>
file
- The object to serialize.outputStream
- The data stream to which the object will be written.
IOException
SerializationException
public String getMIMEType(File file)
Serializer
getMIMEType
in interface Serializer<File>
file
- If provided, allows the serializer to attach parameters to the returned
MIME type containing more detailed information about the data. If
null, the base MIME type is returned.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |