protected int addPacket ( OggPacket packet , int offset ) { if ( packet . isBeginningOfStream ( ) ) { isBOS = true ; } if ( packet . isEndOfStream ( ) ) { isEOS = true ; } // Add on in 255 byte chunks int size = packet . getData ( ) . length ; for ( int i = numLVs ; i < 255 ; i ++ ) { int remains = size - offset ; int toAdd = 255 ; if ( remains < 255 ) { toAdd = remains ; } lvs [ i ] = IOUtils . fromInt ( toAdd ) ; tmpData . write ( packet . getData ( ) , offset , toAdd ) ; numLVs ++ ; offset += toAdd ; if ( toAdd < 255 ) { break ; } } return offset ; }
Adds as much of the packet s data as we can do .