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,
org.apache.mina.core.buffer.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 ITagWriter
IOException
- Any I/O exceptionpublic boolean writeTag(ITag tag) throws IOException
writeTag
in interface ITagWriter
tag
- Tag to writetrue
on success, false
otherwiseIOException
- I/O exceptionpublic boolean writeTag(byte type, org.apache.mina.core.buffer.IoBuffer data) throws IOException
writeTag
in interface ITagWriter
type
- Tag typedata
- Byte datatrue
on success, false
otherwiseIOException
- I/O exceptionpublic boolean writeStream(byte[] b)
writeStream
in interface ITagWriter
b
- Array of bytes to writetrue
on success, false
otherwisepublic void close()
close
in interface ITagWriter
public IStreamableFile getFile()
getFile
in interface ITagWriter
public void setFLV(IFLV flv)
flv
- FLV sourcepublic int getOffset()
getOffset
in interface ITagWriter
public void setOffset(int offset)
offset
- Value to set for offsetpublic long getBytesWritten()
getBytesWritten
in interface ITagWriter
Copyright © 2006-2012 The Red5 Project