Package org.jitsi.impl.neomedia.codec
Class REDBlockIterator
- java.lang.Object
-
- org.jitsi.impl.neomedia.codec.REDBlockIterator
-
-
Constructor Summary
Constructors Constructor Description REDBlockIterator(byte[] buffer, int offset, int length)Ctor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static REDBlockgetPrimaryBlock(byte[] buffer, int offset, int length)Gets the first RED block in the RED payload.booleanhasNext()static booleanisMultiBlock(byte[] buffer, int offset, int length)Returnstrueif a specific RED packet contains multiple blocks;false, otherwise.static REDBlockmatchFirst(Predicate<REDBlock> predicate, byte[] buffer, int offset, int length)Matches a RED block in the RED payload.REDBlocknext()voidremove()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Iterator
forEachRemaining
-
-
-
-
Method Detail
-
matchFirst
public static REDBlock matchFirst(Predicate<REDBlock> predicate, byte[] buffer, int offset, int length)
Matches a RED block in the RED payload.- Parameters:
predicate- the predicate that is used to match the RED block.buffer- the byte buffer that contains the RED payload.offset- the offset in the buffer where the RED payload begins.length- the length of the RED payload.- Returns:
- the first RED block that matches the given predicate, null otherwise.
-
getPrimaryBlock
public static REDBlock getPrimaryBlock(byte[] buffer, int offset, int length)
Gets the first RED block in the RED payload.- Parameters:
buffer- the byte buffer that contains the RED payload.offset- the offset in the buffer where the RED payload begins.length- the length of the RED payload.- Returns:
- the primary RED block if it exists, null otherwise.
-
isMultiBlock
public static boolean isMultiBlock(byte[] buffer, int offset, int length)Returnstrueif a specific RED packet contains multiple blocks;false, otherwise.- Parameters:
buffer- the byte buffer that contains the RED payload.offset- the offset in the buffer where the RED payload begins.length- the length of the RED payload.- Returns:
trueifpktcontains multiple RED blocks; otherwise,false
-
-