public class FLVWriter extends Object implements ITagWriter
| Constructor and Description |
|---|
FLVWriter(File file,
boolean append)
Creates writer implementation with given file and last tag
FLV.java uses this constructor so we have access to the file object
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Ends the writing process, then merges the data file with the flv file header and metadata.
|
long |
getBytesWritten()
Return the bytes written
|
IStreamableFile |
getFile()
Return the file that is written.
|
int |
getOffset()
Return the offset
|
void |
setFLV(IFLV flv)
Setter for FLV object
|
void |
setOffset(int offset)
Setter for offset
|
void |
writeHeader()
Writes the header bytes
|
boolean |
writeStream(byte[] b)
Write a Stream to disk using bytes
|
boolean |
writeTag(byte type,
IoBuffer data)
Write a Tag using bytes
|
boolean |
writeTag(ITag tag)
Writes a Tag object
|
public FLVWriter(File file, boolean append)
file - File output streamappend - true if append to existing filepublic void writeHeader()
throws IOException
writeHeader in interface ITagWriterIOException - Any I/O exceptionpublic boolean writeTag(ITag tag) throws IOException
writeTag in interface ITagWritertag - Tag to writetrue on success, false otherwiseIOException - I/O exceptionpublic boolean writeTag(byte type,
IoBuffer data)
throws IOException
writeTag in interface ITagWritertype - Tag typedata - Byte datatrue on success, false otherwiseIOException - I/O exceptionpublic boolean writeStream(byte[] b)
writeStream in interface ITagWriterb - Array of bytes to writetrue on success, false otherwisepublic void close()
close in interface ITagWriterpublic IStreamableFile getFile()
getFile in interface ITagWriterpublic void setFLV(IFLV flv)
flv - FLV sourcepublic int getOffset()
getOffset in interface ITagWriterpublic void setOffset(int offset)
offset - Value to set for offsetpublic long getBytesWritten()
getBytesWritten in interface ITagWriterCopyright © 2006-2012 The Red5 Project