public override int GetCharCount( byte[] bytes, int index, int count, bool flush ) { int byteCount = count + ( ( lastByte >= 0 ) ? 1 : 0 ); if ( flush && ( byteCount % CharSize != 0 ) ) { throw new ArgumentException( Res.GetString( Res.Enc_InvalidByteInEncoding, new object[1] { -1 } ), (string)null ); } return byteCount / CharSize; }