|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.smaxe.uv.fformat.Flv
public final class Flv
Flv
- FLV file format parser.
Format:
[Header][PreviousTagSize0 (U32)][Tag1][PreviousTagSize1 (U32)][Tag2].... ,
where PreviousTagSize* is size of previous tag, including its header.
For FLV version 1, this value is 11 plus the DataSize of the previous tag.
Nested Class Summary | |
---|---|
static class |
Flv.Header
Header - FLV file header. |
static interface |
Flv.ITagProcessor
ITagProcessor - tag processor. |
static class |
Flv.ScriptData
ScriptData - script data. |
static class |
Flv.Tag
Tag - FLV file tag. |
static class |
Flv.TagProcessorAdapter
TagProcessorAdapter - Flv.ITagProcessor adapter. |
Method Summary | |
---|---|
static void |
checkHeader(byte[] header)
Checks the header of the FLV file correctness. |
static Flv.Header |
readHeader(java.io.InputStream is)
Reads the FLV file header from the is and points
to the first file tag. |
static Flv.ScriptData[] |
readScriptData(java.io.InputStream is,
int length)
Reads script data from the is . |
static int |
readTag(java.io.InputStream is,
Flv.ITagProcessor processor)
Reads the tag from the is |
static void |
writeHeader(java.io.OutputStream os,
Flv.Header header)
Writes the FLV file header to the os . |
static void |
writeScriptData(java.io.OutputStream os,
Flv.ScriptData[] scriptData)
Writes script data to the os . |
static void |
writeTag(java.io.OutputStream os,
int type,
long timestamp,
byte[] buf,
int offset,
int length)
Writes tag to the os . |
static void |
writeTagHeader(java.io.OutputStream os,
int type,
long timestamp,
int dataSize)
Writes tag header to the os . |
static void |
writeTagTrailer(java.io.OutputStream os,
int dataSize)
Writes tag trailer to the os . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static void checkHeader(byte[] header)
header
of the FLV file correctness.
header
- header bytespublic static Flv.Header readHeader(java.io.InputStream is) throws java.io.IOException
is
and points
to the first file tag.
is
-
java.io.IOException
- if an I/O exception occurredpublic static void writeHeader(java.io.OutputStream os, Flv.Header header) throws java.io.IOException
header
to the os
.
os
- header
- flv file header
java.io.IOException
- if an I/O exception occurredpublic static int readTag(java.io.InputStream is, Flv.ITagProcessor processor) throws java.io.IOException
is
is
- processor
- tag processor
-1
if tag is not read
java.io.IOException
- if an I/O exception occurredpublic static void writeTag(java.io.OutputStream os, int type, long timestamp, byte[] buf, int offset, int length) throws java.io.IOException
os
.
os
- type
- tag typetimestamp
- tag timestampbuf
- data bufferoffset
- data buffer offsetlength
- data buffer length
java.io.IOException
- if an I/O exception occurredpublic static void writeTagHeader(java.io.OutputStream os, int type, long timestamp, int dataSize) throws java.io.IOException
os
.
os
- type
- tag typetimestamp
- tag timestampdataSize
- data size
java.io.IOException
- if an I/O exception occurredpublic static void writeTagTrailer(java.io.OutputStream os, int dataSize) throws java.io.IOException
os
.
os
- dataSize
- data size
java.io.IOException
- if an I/O exception occurredpublic static Flv.ScriptData[] readScriptData(java.io.InputStream is, int length) throws java.io.IOException
is
.
is
- length
- data length
java.io.IOException
- if an I/O exception occurredpublic static void writeScriptData(java.io.OutputStream os, Flv.ScriptData[] scriptData) throws java.io.IOException
os
.
os
- scriptData
- script data
java.io.IOException
- if an I/O exception occurred
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |