|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.red5.io.flv.impl.FLVWriter
public class FLVWriter
A Writer is used to write the contents of a FLV file
Constructor Summary | |
---|---|
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 |
Method Summary | |
---|---|
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 |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FLVWriter(File file, boolean append)
file
- File output streamappend
- true if append to existing fileMethod Detail |
---|
public 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 write
true
on success, false
otherwise
IOException
- I/O exceptionpublic boolean writeTag(byte type, IoBuffer data) throws IOException
writeTag
in interface ITagWriter
type
- Tag typedata
- Byte data
true
on success, false
otherwise
IOException
- I/O exceptionpublic boolean writeStream(byte[] b)
writeStream
in interface ITagWriter
b
- Array of bytes to write
true
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
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |