## org.red5.io.flv
Class FLVHeader

    java.lang.Object
      org.red5.io.flv.FLVHeader

    public class FLVHeader

extends Object

FLVHeader parses out the contents of a FLV video file and returns the Header data

Author:
  The Red5 Project (red5@osflash.org), Dominick Accattato (daccattato@gmail.com), Luke Hubbard, Codegent Ltd (luke@codegent.com), Tiago Jacobs (tiago@imdt.com.br)
See Also:
  OSFlash (external)

Field Summary
`int` `dataOffset` reserved for data up to 4,294,967,295
`boolean` `flagAudio` Audio flag
`byte` `flagReserved01` Reserved flag, one
`byte` `flagReserved02` Reserved flag, two
`boolean` `flagVideo` Video flag
`byte[]` `signature` Signature
`byte` `version` FLV version

Constructor Summary
`FLVHeader()`

Method Summary
`int` `getDataOffset()` Returns the data offset bytes
`boolean` `getFlagAudio()` Returns a boolean on whether this data contains audio
`byte` `getFlagReserved01()` Gets the FlagReserved01 which is a datatype specified in the Flash Specification
`byte` `getFlagReserved02()` Gets the FlagReserved02 which is a datatype specified in the Flash Specification
`boolean` `getFlagVideo()` Returns a boolean on whether this data contains video
`byte[]` `getSignature()` Returns the signature bytes
`byte` `getVersion()` Gets the version byte
`void` `setDataOffset(int data_offset)` Sets the data offset bytes
`void` `setFlagAudio(boolean flagAudio)` Sets the audioflag on whether this data contains audio
`void` `setFlagReserved01(byte flagReserved01)` Sets the FlagReserved01 which is a datatype specified in the Flash Specification
`void` `setFlagReserved02(byte flagReserved02)` Sets the Flag Reserved02 which is a datatype specified in the Flash Specification
`void` `setFlagVideo(boolean type_flags_video)` Sets the audioflag on whether this data contains audio
`void` `setSignature(byte[] signature)` Sets the signature bytes
`void` `setTypeFlags(byte typeFlags)` Sets the type flags on whether this data is audio or video
`void` `setVersion(byte version)` Sets the version byte
`String` `toString()` Overrides the toString method so that a FLVHeader can be represented by its datatypes
`void` `write(IoBuffer buffer)` Writes the FLVHeader to IoBuffer.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Field Detail

### signature

    public byte[] signature

  Signature

### version

    public byte version

  FLV version

### flagReserved01

    public byte flagReserved01

  Reserved flag, one

### flagAudio

    public boolean flagAudio

  Audio flag

### flagReserved02

    public byte flagReserved02

  Reserved flag, two

### flagVideo

    public boolean flagVideo

  Video flag

### dataOffset

    public int dataOffset

  reserved for data up to 4,294,967,295

Constructor Detail

### FLVHeader

    public FLVHeader()

Method Detail

### getDataOffset

    public int getDataOffset()

  Returns the data offset bytes

  Returns:
    int Data offset

### setDataOffset

    public void setDataOffset(int data_offset)

  Sets the data offset bytes

  Parameters:
    `data_offset` - Data offset

### getSignature

    public byte[] getSignature()

  Returns the signature bytes

  Returns:
    byte[] Signature

### toString

    public String toString()

  Overrides the toString method so that a FLVHeader can be represented by its datatypes

  Overrides:
    `toString` in class `Object`
  Returns:
    String String representation

### setSignature

    public void setSignature(byte[] signature)

  Sets the signature bytes

  Parameters:
    `signature` - Signature

### getFlagAudio

    public boolean getFlagAudio()

  Returns a boolean on whether this data contains audio

  Returns:
    boolean `true` if this FLV header contains audio data, `false` otherwise

### setFlagAudio

    public void setFlagAudio(boolean flagAudio)

  Sets the audioflag on whether this data contains audio

  Parameters:
    `flagAudio` - `true` if this FLV header contains audio data, `false` otherwise

### setTypeFlags

    public void setTypeFlags(byte typeFlags)

  Sets the type flags on whether this data is audio or video

  Parameters:
    `typeFlags` - Type flags determining data types (audio or video)

### getFlagReserved01

    public byte getFlagReserved01()

  Gets the FlagReserved01 which is a datatype specified in the Flash Specification

  Returns:
    byte Flag reserved, first

### setFlagReserved01

    public void setFlagReserved01(byte flagReserved01)

  Sets the FlagReserved01 which is a datatype specified in the Flash Specification

  Parameters:
    `flagReserved01` - Flag reserved, first

### getFlagReserved02

    public byte getFlagReserved02()

  Gets the FlagReserved02 which is a datatype specified in the Flash Specification

  Returns:
    byte FlagReserved02

### setFlagReserved02

    public void setFlagReserved02(byte flagReserved02)

  Sets the Flag Reserved02 which is a datatype specified in the Flash Specification

  Parameters:
    `flagReserved02` - FlagReserved02

### getFlagVideo

    public boolean getFlagVideo()

  Returns a boolean on whether this data contains video

  Returns:
    boolean `true` if this FLV header contains vide data, `false` otherwise

### setFlagVideo

    public void setFlagVideo(boolean type_flags_video)

  Sets the audioflag on whether this data contains audio

  Parameters:
    `type_flags_video` - `true` if this FLV header contains video data, `false` otherwise

### getVersion

    public byte getVersion()

  Gets the version byte

  Returns:
    byte FLV version byte

### setVersion

    public void setVersion(byte version)

  Sets the version byte

  Parameters:
    `version` - FLV version byte

### write

    public void write(IoBuffer buffer)

  Writes the FLVHeader to IoBuffer.

  Parameters:
    `buffer` - IoBuffer to write

Copyright © 2006-2010 The Red5 Project