public class FileOutput extends AbstractBinaryOutput implements LockableStream, EnvCleanup
SEEK_CUR, SEEK_END, SEEK_SET| Constructor and Description |
|---|
FileOutput(Env env,
Path path) |
FileOutput(Env env,
Path path,
boolean isAppend) |
| Modifier and Type | Method and Description |
|---|---|
void |
cleanup()
Implements the EnvCleanup interface.
|
void |
close()
Closes the file.
|
void |
closeWrite()
Closes the file.
|
void |
flush()
Flushes the output.
|
java.io.OutputStream |
getOutputStream()
Returns the write stream.
|
Path |
getPath()
Returns the file's path.
|
long |
getPosition()
Returns the current location in the file.
|
boolean |
lock(boolean shared,
boolean block)
Lock the shared advisory lock.
|
void |
print(char v)
Prints a string to a file.
|
void |
print(java.lang.String v)
Prints a string to a file.
|
boolean |
setPosition(long offset)
Sets the current location in the stream
|
Value |
stat()
Returns an array filled with stat information.
|
java.lang.String |
toString()
Converts to a string.
|
boolean |
unlock()
Unlock the advisory lock.
|
void |
write(byte[] buffer,
int offset,
int length)
Writes a buffer to a file.
|
void |
write(int ch)
Writes a character
|
getResourceType, isEOF, seek, writepublic FileOutput(Env env, Path path) throws java.io.IOException
java.io.IOExceptionpublic java.io.OutputStream getOutputStream()
getOutputStream in interface BinaryOutputgetOutputStream in class AbstractBinaryOutputpublic Path getPath()
public void print(char v)
throws java.io.IOException
print in interface BinaryOutputprint in class AbstractBinaryOutputjava.io.IOExceptionpublic void print(java.lang.String v)
throws java.io.IOException
print in interface BinaryOutputprint in class AbstractBinaryOutputjava.io.IOExceptionpublic void write(int ch)
throws java.io.IOException
write in class java.io.OutputStreamjava.io.IOExceptionpublic void write(byte[] buffer,
int offset,
int length)
throws java.io.IOException
write in interface BinaryOutputwrite in class java.io.OutputStreamjava.io.IOExceptionpublic void flush()
throws java.io.IOException
flush in interface BinaryOutputflush in interface java.io.Flushableflush in class AbstractBinaryOutputjava.io.IOExceptionpublic void closeWrite()
closeWrite in interface BinaryOutputcloseWrite in class AbstractBinaryOutputpublic void close()
close in interface BinaryOutputclose in interface BinaryStreamclose in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class AbstractBinaryOutputpublic void cleanup()
cleanup in interface EnvCleanuppublic boolean lock(boolean shared,
boolean block)
lock in interface LockableStreampublic boolean unlock()
unlock in interface LockableStreampublic Value stat()
BinaryStreamstat in interface BinaryStreamstat in class AbstractBinaryOutputpublic long getPosition()
getPosition in interface BinaryStreamgetPosition in class AbstractBinaryOutputpublic boolean setPosition(long offset)
setPosition in interface BinaryStreamsetPosition in class AbstractBinaryOutputpublic java.lang.String toString()
toString in class java.lang.Objectenv -