|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.continuent.tungsten.common.io.BufferedFileDataOutput
public class BufferedFileDataOutput
Merges the capabilities of the following stream classes into a single class: FileOutputStream, BufferedOutputStream, and DataOutputStream. This allows us to manage buffered data writes to files efficiently.
| Constructor Summary | |
|---|---|
BufferedFileDataOutput(java.io.File file)
Creates instance with default buffer size. |
|
BufferedFileDataOutput(java.io.File file,
int bufferSize)
Creates instance positioned on end of file and read to write. |
|
| Method Summary | |
|---|---|
void |
close()
Close and release all resources. |
void |
flush()
Flush buffered data to stream. |
void |
fsync()
Synchronizes file contents to disk using fsync. |
long |
getOffset()
Returns the current offset position. |
void |
setLength(long length)
Truncate the file to the provided length. |
java.lang.String |
toString()
Print contents of the reader. |
void |
write(byte[] bytes)
Writes a byte array completely. |
void |
writeByte(byte v)
Writes a single byte. |
void |
writeInt(int v)
Writes a single int. |
void |
writeLong(long v)
Writes a single long. |
void |
writeShort(short v)
Writes a single short. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public BufferedFileDataOutput(java.io.File file,
int bufferSize)
throws java.io.FileNotFoundException,
java.io.IOException
file - File to which to write.bufferSize - Size of buffer for buffered I/O
java.io.FileNotFoundException
java.io.IOException
public BufferedFileDataOutput(java.io.File file)
throws java.io.FileNotFoundException,
java.io.IOException
java.io.FileNotFoundException
java.io.IOException| Method Detail |
|---|
public long getOffset()
throws java.io.IOException
java.io.IOException - Thrown if position cannot be determined
public void writeByte(byte v)
throws java.io.IOException
java.io.IOException
public void writeShort(short v)
throws java.io.IOException
java.io.IOException
public void writeInt(int v)
throws java.io.IOException
java.io.IOException
public void writeLong(long v)
throws java.io.IOException
java.io.IOException
public void write(byte[] bytes)
throws java.io.IOException
java.io.IOException - Thrown if full byte array cannot be written
public void flush()
throws java.io.IOException
java.io.IOException - Thrown if flush fails
public void fsync()
throws java.io.IOException
java.io.IOException
public void setLength(long length)
throws java.io.IOException
java.io.IOExceptionpublic void close()
public java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||