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
IOException
public void close() throws IOException
IOException
public void synch() throws IOException
IOException
public void delete() throws IOException
IOException
public void readFully(long position, byte[] buf, int off, int len) throws IOException
IOException
public long length()
public OutputStream getOutputStream() throws IOException
IOException
public InputStream getInputStream() throws IOException
IOException
Copyright © 2015. All rights reserved.