|
Sharkysoft home | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--lava.riff.RiffOutputFile
File-based RIFF data sink.
Details: This class is a file-IRiffOutput.
| Constructor Summary | |
RiffOutputFile(java.io.File dest)
Binds to file. |
|
| Method Summary | |
void |
close()
Closes stream. |
void |
commit(long pos)
Commits BYTEs. |
long |
getLength()
Returns stream length. |
long |
getPosition()
Returns write offset. |
void |
setLength(long newlen)
Sets stream length. |
void |
setPosition(long pos)
Sets write offset. |
void |
write(byte[] src,
int offset,
int amount)
Writes BYTEs. |
void |
write(int c)
Writes BYTE. |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Constructor Detail |
public RiffOutputFile(java.io.File dest)
throws java.io.IOException
Details: This constructor initializes a new instance to write data to the given file (file). If the destination file exists, it will be deleted.
file - the input file| Method Detail |
public void setLength(long newlen)
throws java.io.IOException
Details: This method sets the length of this stream to length. Declaring the stream's length in advance can help some implementations perform more efficiently and should be done whenever possible. It is illegal to call setLength with a length value that is less than the current flush pointer. If the sequence is closed before length bytes are written, the implementation may choose unpredictable values for the remaining bytes.
length - the new length of this stream
public long getLength()
throws java.io.IOException
Details: This method returns the length of this stream if it is known, or -1 otherwise.
public void setPosition(long pos)
throws java.io.IOException
Details: This method sets the write offset, or the offset of the next BYTE to be written. If the new offset is less than the flush pointer, an error may occur.
newpos - the new position
public long getPosition()
throws java.io.IOException
Details: This method returns the offset of the next BYTE that will be written if a write method is called.
public void write(int c)
throws java.io.IOException
Details: This method writes a single BYTE (b) to the output stream. Only the least significant 8 bits of b are used.
b - the byte
public void write(byte[] src,
int offset,
int amount)
throws java.io.IOException
Details: This method writes a sequence of BYTEs to the output stream. The BYTEs are read from the source array (src) beginning at the given offset (offset). amount BYTEs are written. The write offset is advanced by the number of bytes written.
src - the sequence of bytesoffset - offset into srcamount - number of bytes to write
public void commit(long pos)
throws java.io.IOException
Details: This method freezes and commits the bytes written up to the given offset (upto). The values of bytes written to this point should no longer be modified. Bytes whose offsets are less than the new commit offset which were never written may be filled with zeros or unpredictable values.
It is acceptable to call commit with an upto value that is less than the current commit offset, but doing so has no effect.
upto - the new commit offset
public void close()
throws java.io.IOException
Details: This method commits all BYTEs that are currently buffered and releases resources associated with this implementation.
|
Sharkysoft home | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||