public class StreamFile extends Object
| Constructor and Description |
|---|
StreamFile(File file,
String mode)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the file.
|
void |
delete()
Deletes the file.
|
InputStream |
getInputStream()
Returns an InputStream to the file that allows us to read from the start
to the end of the file.
|
OutputStream |
getOutputStream()
Opens an OutputStream to the file.
|
long |
length()
Returns the current length of the data.
|
void |
readFully(long position,
byte[] buf,
int off,
int len)
Fully reads a block from a section of the file into the given byte[]
array at the given position.
|
void |
synch()
Synchs the file.
|
public StreamFile(File file, String mode) throws IOException
IOExceptionpublic void close()
throws IOException
IOExceptionpublic void synch()
throws IOException
IOExceptionpublic void delete()
throws IOException
IOExceptionpublic void readFully(long position,
byte[] buf,
int off,
int len)
throws IOException
IOExceptionpublic long length()
public OutputStream getOutputStream() throws IOException
IOExceptionpublic InputStream getInputStream() throws IOException
IOExceptionCopyright © 2016. All rights reserved.