getFilePointer

seek

public void seek(long pos)
throws java.io.IOException

Sets the file-pointer offset, measured from the beginning of this stream, at which the next write operation will occur.

The offset may be set beyond the end of the stream. Setting the offset beyond the end of the stream does not change the stream length; the stream length will change only by writing after the offset has been set beyond the end of the stream.

write

Writes the specified number of bytes from the specified byte array to the file.

Overrides:

write in class java.io.OutputStream

Parameters:

b - the buffer containing the data to be written to the file.

off - the starting position for the offset in the buffer.

len - the number of bytes to write to the file.

Throws:

java.io.IOException - if an IO error occurs.

flush

public void flush()
throws java.io.IOException

Flushes the output stream and forces any buffered output bytes to be written to the file.

There is little need to call this method until all the data has been written because the close method includes a call to the flush method.

Specified by:

flush in interface java.io.Flushable

Overrides:

flush in class java.io.OutputStream

Throws:

java.io.IOException - if an IO error occurs.

close

public void close()
throws java.io.IOException

Closes the output stream and releases any resources associated with this stream. Before closing the stream, this method automatically calls the flush() method to write any buffered bytes to the stream.