public void appendToNalUnit(byte[] data,int offset,int limit){
  if (!isFilling) {
    return;
  }
  int readLength=limit - offset;
  if (ifrData.length < ifrLength + readLength) {
    ifrData=Arrays.copyOf(ifrData,(ifrLength + readLength) * 2);
  }
  System.arraycopy(data,offset,ifrData,ifrLength,readLength);
  ifrLength+=readLength;
  scratchSliceType.reset(ifrData,ifrLength);
  scratchSliceType.skipBits(8);
  int len=scratchSliceType.peekExpGolombCodedNumLength();
  if ((len == -1) || (len > scratchSliceType.bitsLeft())) {
    return;
  }
  scratchSliceType.skipBits(len);
  len=scratchSliceType.peekExpGolombCodedNumLength();
  if ((len == -1) || (len > scratchSliceType.bitsLeft())) {
    return;
  }
  sliceType=scratchSliceType.readUnsignedExpGolombCodedInt();
  isFilling=false;
}

public void appendToNalUnit ( byte [ ] data , int offset , int limit ) { if ( ! isFilling ) { return ; } int readLength = limit - offset ; if ( ifrData . length < ifrLength + readLength ) { ifrData = Arrays . copyOf ( ifrData , ( ifrLength + readLength ) * 2 ) ; } System . arraycopy ( data , offset , ifrData , ifrLength , readLength ) ; ifrLength += readLength ; scratchSliceType . reset ( ifrData , ifrLength ) ; scratchSliceType . skipBits ( 8 ) ; int len = scratchSliceType . peekExpGolombCodedNumLength ( ) ; if ( ( len == - 1 ) || ( len > scratchSliceType . bitsLeft ( ) ) ) { return ; } scratchSliceType . skipBits ( len ) ; len = scratchSliceType . peekExpGolombCodedNumLength ( ) ; if ( ( len == - 1 ) || ( len > scratchSliceType . bitsLeft ( ) ) ) { return ; } sliceType = scratchSliceType . readUnsignedExpGolombCodedInt ( ) ; isFilling = false ; }
invoked to pass stream data . the data passed should not include the 3 byte start code .
