private static long discard ( ByteBuf buffer , long remainingToDiscard ) { int availableToDiscard = ( int ) Math . min ( remainingToDiscard , buffer . readableBytes ( ) ) ; buffer . skipBytes ( availableToDiscard ) ; return remainingToDiscard - availableToDiscard ; }
How much remains to be discarded