Buffer.smali 124 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844
  1. .class public final Lokio/Buffer;
  2. .super Ljava/lang/Object;
  3. .source ""
  4. # interfaces
  5. .implements Lokio/BufferedSource;
  6. .implements Lokio/BufferedSink;
  7. .implements Ljava/lang/Cloneable;
  8. # static fields
  9. .field private static final DIGITS:[B
  10. .field static final REPLACEMENT_CHARACTER:I = 0xfffd
  11. # instance fields
  12. .field head:Lokio/Segment;
  13. .field size:J
  14. # direct methods
  15. .method static constructor <clinit>()V
  16. .locals 1
  17. const/16 v0, 0x10
  18. new-array v0, v0, [B
  19. fill-array-data v0, :array_0
  20. sput-object v0, Lokio/Buffer;->DIGITS:[B
  21. return-void
  22. :array_0
  23. .array-data 1
  24. 0x30t
  25. 0x31t
  26. 0x32t
  27. 0x33t
  28. 0x34t
  29. 0x35t
  30. 0x36t
  31. 0x37t
  32. 0x38t
  33. 0x39t
  34. 0x61t
  35. 0x62t
  36. 0x63t
  37. 0x64t
  38. 0x65t
  39. 0x66t
  40. .end array-data
  41. .end method
  42. .method public constructor <init>()V
  43. .locals 0
  44. invoke-direct {p0}, Ljava/lang/Object;-><init>()V
  45. return-void
  46. .end method
  47. .method private digest(Ljava/lang/String;)Lokio/ByteString;
  48. .locals 5
  49. :try_start_0
  50. invoke-static {p1}, Ljava/security/MessageDigest;->getInstance(Ljava/lang/String;)Ljava/security/MessageDigest;
  51. move-result-object p1
  52. iget-object v0, p0, Lokio/Buffer;->head:Lokio/Segment;
  53. if-eqz v0, :cond_0
  54. iget-object v0, p0, Lokio/Buffer;->head:Lokio/Segment;
  55. iget-object v0, v0, Lokio/Segment;->data:[B
  56. iget-object v1, p0, Lokio/Buffer;->head:Lokio/Segment;
  57. iget v1, v1, Lokio/Segment;->pos:I
  58. iget-object v2, p0, Lokio/Buffer;->head:Lokio/Segment;
  59. iget v2, v2, Lokio/Segment;->limit:I
  60. iget-object v3, p0, Lokio/Buffer;->head:Lokio/Segment;
  61. iget v3, v3, Lokio/Segment;->pos:I
  62. sub-int/2addr v2, v3
  63. invoke-virtual {p1, v0, v1, v2}, Ljava/security/MessageDigest;->update([BII)V
  64. iget-object v0, p0, Lokio/Buffer;->head:Lokio/Segment;
  65. :goto_0
  66. iget-object v0, v0, Lokio/Segment;->next:Lokio/Segment;
  67. iget-object v1, p0, Lokio/Buffer;->head:Lokio/Segment;
  68. if-eq v0, v1, :cond_0
  69. iget-object v1, v0, Lokio/Segment;->data:[B
  70. iget v2, v0, Lokio/Segment;->pos:I
  71. iget v3, v0, Lokio/Segment;->limit:I
  72. iget v4, v0, Lokio/Segment;->pos:I
  73. sub-int/2addr v3, v4
  74. invoke-virtual {p1, v1, v2, v3}, Ljava/security/MessageDigest;->update([BII)V
  75. goto :goto_0
  76. :cond_0
  77. invoke-virtual {p1}, Ljava/security/MessageDigest;->digest()[B
  78. move-result-object p1
  79. invoke-static {p1}, Lokio/ByteString;->of([B)Lokio/ByteString;
  80. move-result-object p1
  81. :try_end_0
  82. .catch Ljava/security/NoSuchAlgorithmException; {:try_start_0 .. :try_end_0} :catch_0
  83. return-object p1
  84. :catch_0
  85. new-instance p1, Ljava/lang/AssertionError;
  86. invoke-direct {p1}, Ljava/lang/AssertionError;-><init>()V
  87. goto :goto_2
  88. :goto_1
  89. throw p1
  90. :goto_2
  91. goto :goto_1
  92. .end method
  93. .method private hmac(Ljava/lang/String;Lokio/ByteString;)Lokio/ByteString;
  94. .locals 4
  95. :try_start_0
  96. invoke-static {p1}, Ljavax/crypto/Mac;->getInstance(Ljava/lang/String;)Ljavax/crypto/Mac;
  97. move-result-object v0
  98. new-instance v1, Ljavax/crypto/spec/SecretKeySpec;
  99. invoke-virtual {p2}, Lokio/ByteString;->toByteArray()[B
  100. move-result-object p2
  101. invoke-direct {v1, p2, p1}, Ljavax/crypto/spec/SecretKeySpec;-><init>([BLjava/lang/String;)V
  102. invoke-virtual {v0, v1}, Ljavax/crypto/Mac;->init(Ljava/security/Key;)V
  103. iget-object p1, p0, Lokio/Buffer;->head:Lokio/Segment;
  104. if-eqz p1, :cond_0
  105. iget-object p1, p0, Lokio/Buffer;->head:Lokio/Segment;
  106. iget-object p1, p1, Lokio/Segment;->data:[B
  107. iget-object p2, p0, Lokio/Buffer;->head:Lokio/Segment;
  108. iget p2, p2, Lokio/Segment;->pos:I
  109. iget-object v1, p0, Lokio/Buffer;->head:Lokio/Segment;
  110. iget v1, v1, Lokio/Segment;->limit:I
  111. iget-object v2, p0, Lokio/Buffer;->head:Lokio/Segment;
  112. iget v2, v2, Lokio/Segment;->pos:I
  113. sub-int/2addr v1, v2
  114. invoke-virtual {v0, p1, p2, v1}, Ljavax/crypto/Mac;->update([BII)V
  115. iget-object p1, p0, Lokio/Buffer;->head:Lokio/Segment;
  116. :goto_0
  117. iget-object p1, p1, Lokio/Segment;->next:Lokio/Segment;
  118. iget-object p2, p0, Lokio/Buffer;->head:Lokio/Segment;
  119. if-eq p1, p2, :cond_0
  120. iget-object p2, p1, Lokio/Segment;->data:[B
  121. iget v1, p1, Lokio/Segment;->pos:I
  122. iget v2, p1, Lokio/Segment;->limit:I
  123. iget v3, p1, Lokio/Segment;->pos:I
  124. sub-int/2addr v2, v3
  125. invoke-virtual {v0, p2, v1, v2}, Ljavax/crypto/Mac;->update([BII)V
  126. goto :goto_0
  127. :cond_0
  128. invoke-virtual {v0}, Ljavax/crypto/Mac;->doFinal()[B
  129. move-result-object p1
  130. invoke-static {p1}, Lokio/ByteString;->of([B)Lokio/ByteString;
  131. move-result-object p1
  132. :try_end_0
  133. .catch Ljava/security/NoSuchAlgorithmException; {:try_start_0 .. :try_end_0} :catch_1
  134. .catch Ljava/security/InvalidKeyException; {:try_start_0 .. :try_end_0} :catch_0
  135. return-object p1
  136. :catch_0
  137. move-exception p1
  138. new-instance p2, Ljava/lang/IllegalArgumentException;
  139. invoke-direct {p2, p1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/Throwable;)V
  140. throw p2
  141. :catch_1
  142. new-instance p1, Ljava/lang/AssertionError;
  143. invoke-direct {p1}, Ljava/lang/AssertionError;-><init>()V
  144. goto :goto_2
  145. :goto_1
  146. throw p1
  147. :goto_2
  148. goto :goto_1
  149. .end method
  150. .method private rangeEquals(Lokio/Segment;ILokio/ByteString;II)Z
  151. .locals 5
  152. iget v0, p1, Lokio/Segment;->limit:I
  153. iget-object v1, p1, Lokio/Segment;->data:[B
  154. :goto_0
  155. if-ge p4, p5, :cond_2
  156. if-ne p2, v0, :cond_0
  157. iget-object p1, p1, Lokio/Segment;->next:Lokio/Segment;
  158. iget-object p2, p1, Lokio/Segment;->data:[B
  159. iget v0, p1, Lokio/Segment;->pos:I
  160. iget v1, p1, Lokio/Segment;->limit:I
  161. move v4, v1
  162. move-object v1, p2
  163. move p2, v0
  164. move v0, v4
  165. :cond_0
  166. aget-byte v2, v1, p2
  167. invoke-virtual {p3, p4}, Lokio/ByteString;->getByte(I)B
  168. move-result v3
  169. if-eq v2, v3, :cond_1
  170. const/4 p1, 0x0
  171. return p1
  172. :cond_1
  173. add-int/lit8 p2, p2, 0x1
  174. add-int/lit8 p4, p4, 0x1
  175. goto :goto_0
  176. :cond_2
  177. const/4 p1, 0x1
  178. return p1
  179. .end method
  180. .method private readFrom(Ljava/io/InputStream;JZ)V
  181. .locals 4
  182. .annotation system Ldalvik/annotation/Throws;
  183. value = {
  184. Ljava/io/IOException;
  185. }
  186. .end annotation
  187. if-eqz p1, :cond_4
  188. :goto_0
  189. const-wide/16 v0, 0x0
  190. cmp-long v2, p2, v0
  191. if-gtz v2, :cond_1
  192. if-eqz p4, :cond_0
  193. goto :goto_1
  194. :cond_0
  195. return-void
  196. :cond_1
  197. :goto_1
  198. const/4 v0, 0x1
  199. invoke-virtual {p0, v0}, Lokio/Buffer;->writableSegment(I)Lokio/Segment;
  200. move-result-object v0
  201. iget v1, v0, Lokio/Segment;->limit:I
  202. rsub-int v1, v1, 0x2000
  203. int-to-long v1, v1
  204. invoke-static {p2, p3, v1, v2}, Ljava/lang/Math;->min(JJ)J
  205. move-result-wide v1
  206. long-to-int v2, v1
  207. iget-object v1, v0, Lokio/Segment;->data:[B
  208. iget v3, v0, Lokio/Segment;->limit:I
  209. invoke-virtual {p1, v1, v3, v2}, Ljava/io/InputStream;->read([BII)I
  210. move-result v1
  211. const/4 v2, -0x1
  212. if-ne v1, v2, :cond_3
  213. if-eqz p4, :cond_2
  214. return-void
  215. :cond_2
  216. new-instance p1, Ljava/io/EOFException;
  217. invoke-direct {p1}, Ljava/io/EOFException;-><init>()V
  218. throw p1
  219. :cond_3
  220. iget v2, v0, Lokio/Segment;->limit:I
  221. add-int/2addr v2, v1
  222. iput v2, v0, Lokio/Segment;->limit:I
  223. iget-wide v2, p0, Lokio/Buffer;->size:J
  224. int-to-long v0, v1
  225. add-long/2addr v2, v0
  226. iput-wide v2, p0, Lokio/Buffer;->size:J
  227. sub-long/2addr p2, v0
  228. goto :goto_0
  229. :cond_4
  230. new-instance p1, Ljava/lang/IllegalArgumentException;
  231. const-string p2, "in == null"
  232. invoke-direct {p1, p2}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
  233. goto :goto_3
  234. :goto_2
  235. throw p1
  236. :goto_3
  237. goto :goto_2
  238. .end method
  239. # virtual methods
  240. .method public buffer()Lokio/Buffer;
  241. .locals 0
  242. return-object p0
  243. .end method
  244. .method public clear()V
  245. .locals 2
  246. :try_start_0
  247. iget-wide v0, p0, Lokio/Buffer;->size:J
  248. invoke-virtual {p0, v0, v1}, Lokio/Buffer;->skip(J)V
  249. :try_end_0
  250. .catch Ljava/io/EOFException; {:try_start_0 .. :try_end_0} :catch_0
  251. return-void
  252. :catch_0
  253. move-exception v0
  254. new-instance v1, Ljava/lang/AssertionError;
  255. invoke-direct {v1, v0}, Ljava/lang/AssertionError;-><init>(Ljava/lang/Object;)V
  256. throw v1
  257. .end method
  258. .method public bridge synthetic clone()Ljava/lang/Object;
  259. .locals 1
  260. .annotation system Ldalvik/annotation/Throws;
  261. value = {
  262. Ljava/lang/CloneNotSupportedException;
  263. }
  264. .end annotation
  265. invoke-virtual {p0}, Lokio/Buffer;->clone()Lokio/Buffer;
  266. move-result-object v0
  267. return-object v0
  268. .end method
  269. .method public clone()Lokio/Buffer;
  270. .locals 6
  271. new-instance v0, Lokio/Buffer;
  272. invoke-direct {v0}, Lokio/Buffer;-><init>()V
  273. iget-wide v1, p0, Lokio/Buffer;->size:J
  274. const-wide/16 v3, 0x0
  275. cmp-long v5, v1, v3
  276. if-nez v5, :cond_0
  277. return-object v0
  278. :cond_0
  279. new-instance v1, Lokio/Segment;
  280. iget-object v2, p0, Lokio/Buffer;->head:Lokio/Segment;
  281. invoke-direct {v1, v2}, Lokio/Segment;-><init>(Lokio/Segment;)V
  282. iput-object v1, v0, Lokio/Buffer;->head:Lokio/Segment;
  283. iget-object v1, v0, Lokio/Buffer;->head:Lokio/Segment;
  284. iput-object v1, v1, Lokio/Segment;->prev:Lokio/Segment;
  285. iput-object v1, v1, Lokio/Segment;->next:Lokio/Segment;
  286. iget-object v1, p0, Lokio/Buffer;->head:Lokio/Segment;
  287. :goto_0
  288. iget-object v1, v1, Lokio/Segment;->next:Lokio/Segment;
  289. iget-object v2, p0, Lokio/Buffer;->head:Lokio/Segment;
  290. if-eq v1, v2, :cond_1
  291. iget-object v2, v0, Lokio/Buffer;->head:Lokio/Segment;
  292. iget-object v2, v2, Lokio/Segment;->prev:Lokio/Segment;
  293. new-instance v3, Lokio/Segment;
  294. invoke-direct {v3, v1}, Lokio/Segment;-><init>(Lokio/Segment;)V
  295. invoke-virtual {v2, v3}, Lokio/Segment;->push(Lokio/Segment;)Lokio/Segment;
  296. goto :goto_0
  297. :cond_1
  298. iget-wide v1, p0, Lokio/Buffer;->size:J
  299. iput-wide v1, v0, Lokio/Buffer;->size:J
  300. return-object v0
  301. .end method
  302. .method public close()V
  303. .locals 0
  304. return-void
  305. .end method
  306. .method public completeSegmentByteCount()J
  307. .locals 5
  308. iget-wide v0, p0, Lokio/Buffer;->size:J
  309. const-wide/16 v2, 0x0
  310. cmp-long v4, v0, v2
  311. if-nez v4, :cond_0
  312. return-wide v2
  313. :cond_0
  314. iget-object v2, p0, Lokio/Buffer;->head:Lokio/Segment;
  315. iget-object v2, v2, Lokio/Segment;->prev:Lokio/Segment;
  316. iget v3, v2, Lokio/Segment;->limit:I
  317. const/16 v4, 0x2000
  318. if-ge v3, v4, :cond_1
  319. iget-boolean v4, v2, Lokio/Segment;->owner:Z
  320. if-eqz v4, :cond_1
  321. iget v2, v2, Lokio/Segment;->pos:I
  322. sub-int/2addr v3, v2
  323. int-to-long v2, v3
  324. sub-long/2addr v0, v2
  325. :cond_1
  326. return-wide v0
  327. .end method
  328. .method public copyTo(Ljava/io/OutputStream;)Lokio/Buffer;
  329. .locals 6
  330. .annotation system Ldalvik/annotation/Throws;
  331. value = {
  332. Ljava/io/IOException;
  333. }
  334. .end annotation
  335. iget-wide v4, p0, Lokio/Buffer;->size:J
  336. const-wide/16 v2, 0x0
  337. move-object v0, p0
  338. move-object v1, p1
  339. invoke-virtual/range {v0 .. v5}, Lokio/Buffer;->copyTo(Ljava/io/OutputStream;JJ)Lokio/Buffer;
  340. move-result-object p1
  341. return-object p1
  342. .end method
  343. .method public copyTo(Ljava/io/OutputStream;JJ)Lokio/Buffer;
  344. .locals 8
  345. .annotation system Ldalvik/annotation/Throws;
  346. value = {
  347. Ljava/io/IOException;
  348. }
  349. .end annotation
  350. if-eqz p1, :cond_3
  351. iget-wide v0, p0, Lokio/Buffer;->size:J
  352. move-wide v2, p2
  353. move-wide v4, p4
  354. invoke-static/range {v0 .. v5}, Lokio/Util;->checkOffsetAndCount(JJJ)V
  355. const-wide/16 v0, 0x0
  356. cmp-long v2, p4, v0
  357. if-nez v2, :cond_0
  358. return-object p0
  359. :cond_0
  360. iget-object v2, p0, Lokio/Buffer;->head:Lokio/Segment;
  361. :goto_0
  362. iget v3, v2, Lokio/Segment;->limit:I
  363. iget v4, v2, Lokio/Segment;->pos:I
  364. sub-int v5, v3, v4
  365. int-to-long v5, v5
  366. cmp-long v7, p2, v5
  367. if-ltz v7, :cond_1
  368. sub-int/2addr v3, v4
  369. int-to-long v3, v3
  370. sub-long/2addr p2, v3
  371. iget-object v2, v2, Lokio/Segment;->next:Lokio/Segment;
  372. goto :goto_0
  373. :cond_1
  374. :goto_1
  375. cmp-long v3, p4, v0
  376. if-lez v3, :cond_2
  377. iget v3, v2, Lokio/Segment;->pos:I
  378. int-to-long v3, v3
  379. add-long/2addr v3, p2
  380. long-to-int p2, v3
  381. iget p3, v2, Lokio/Segment;->limit:I
  382. sub-int/2addr p3, p2
  383. int-to-long v3, p3
  384. invoke-static {v3, v4, p4, p5}, Ljava/lang/Math;->min(JJ)J
  385. move-result-wide v3
  386. long-to-int p3, v3
  387. iget-object v3, v2, Lokio/Segment;->data:[B
  388. invoke-virtual {p1, v3, p2, p3}, Ljava/io/OutputStream;->write([BII)V
  389. int-to-long p2, p3
  390. sub-long/2addr p4, p2
  391. iget-object v2, v2, Lokio/Segment;->next:Lokio/Segment;
  392. move-wide p2, v0
  393. goto :goto_1
  394. :cond_2
  395. return-object p0
  396. :cond_3
  397. new-instance p1, Ljava/lang/IllegalArgumentException;
  398. const-string p2, "out == null"
  399. invoke-direct {p1, p2}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
  400. goto :goto_3
  401. :goto_2
  402. throw p1
  403. :goto_3
  404. goto :goto_2
  405. .end method
  406. .method public copyTo(Lokio/Buffer;JJ)Lokio/Buffer;
  407. .locals 8
  408. if-eqz p1, :cond_4
  409. iget-wide v0, p0, Lokio/Buffer;->size:J
  410. move-wide v2, p2
  411. move-wide v4, p4
  412. invoke-static/range {v0 .. v5}, Lokio/Util;->checkOffsetAndCount(JJJ)V
  413. const-wide/16 v0, 0x0
  414. cmp-long v2, p4, v0
  415. if-nez v2, :cond_0
  416. return-object p0
  417. :cond_0
  418. iget-wide v2, p1, Lokio/Buffer;->size:J
  419. add-long/2addr v2, p4
  420. iput-wide v2, p1, Lokio/Buffer;->size:J
  421. iget-object v2, p0, Lokio/Buffer;->head:Lokio/Segment;
  422. :goto_0
  423. iget v3, v2, Lokio/Segment;->limit:I
  424. iget v4, v2, Lokio/Segment;->pos:I
  425. sub-int v5, v3, v4
  426. int-to-long v5, v5
  427. cmp-long v7, p2, v5
  428. if-ltz v7, :cond_1
  429. sub-int/2addr v3, v4
  430. int-to-long v3, v3
  431. sub-long/2addr p2, v3
  432. iget-object v2, v2, Lokio/Segment;->next:Lokio/Segment;
  433. goto :goto_0
  434. :cond_1
  435. :goto_1
  436. cmp-long v3, p4, v0
  437. if-lez v3, :cond_3
  438. new-instance v3, Lokio/Segment;
  439. invoke-direct {v3, v2}, Lokio/Segment;-><init>(Lokio/Segment;)V
  440. iget v4, v3, Lokio/Segment;->pos:I
  441. int-to-long v4, v4
  442. add-long/2addr v4, p2
  443. long-to-int p2, v4
  444. iput p2, v3, Lokio/Segment;->pos:I
  445. iget p2, v3, Lokio/Segment;->pos:I
  446. long-to-int p3, p4
  447. add-int/2addr p2, p3
  448. iget p3, v3, Lokio/Segment;->limit:I
  449. invoke-static {p2, p3}, Ljava/lang/Math;->min(II)I
  450. move-result p2
  451. iput p2, v3, Lokio/Segment;->limit:I
  452. iget-object p2, p1, Lokio/Buffer;->head:Lokio/Segment;
  453. if-nez p2, :cond_2
  454. iput-object v3, v3, Lokio/Segment;->prev:Lokio/Segment;
  455. iput-object v3, v3, Lokio/Segment;->next:Lokio/Segment;
  456. iput-object v3, p1, Lokio/Buffer;->head:Lokio/Segment;
  457. goto :goto_2
  458. :cond_2
  459. iget-object p2, p2, Lokio/Segment;->prev:Lokio/Segment;
  460. invoke-virtual {p2, v3}, Lokio/Segment;->push(Lokio/Segment;)Lokio/Segment;
  461. :goto_2
  462. iget p2, v3, Lokio/Segment;->limit:I
  463. iget p3, v3, Lokio/Segment;->pos:I
  464. sub-int/2addr p2, p3
  465. int-to-long p2, p2
  466. sub-long/2addr p4, p2
  467. iget-object v2, v2, Lokio/Segment;->next:Lokio/Segment;
  468. move-wide p2, v0
  469. goto :goto_1
  470. :cond_3
  471. return-object p0
  472. :cond_4
  473. new-instance p1, Ljava/lang/IllegalArgumentException;
  474. const-string p2, "out == null"
  475. invoke-direct {p1, p2}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
  476. goto :goto_4
  477. :goto_3
  478. throw p1
  479. :goto_4
  480. goto :goto_3
  481. .end method
  482. .method public emit()Lokio/BufferedSink;
  483. .locals 0
  484. return-object p0
  485. .end method
  486. .method public emitCompleteSegments()Lokio/Buffer;
  487. .locals 0
  488. return-object p0
  489. .end method
  490. .method public bridge synthetic emitCompleteSegments()Lokio/BufferedSink;
  491. .locals 1
  492. .annotation system Ldalvik/annotation/Throws;
  493. value = {
  494. Ljava/io/IOException;
  495. }
  496. .end annotation
  497. invoke-virtual {p0}, Lokio/Buffer;->emitCompleteSegments()Lokio/Buffer;
  498. move-result-object v0
  499. return-object v0
  500. .end method
  501. .method public equals(Ljava/lang/Object;)Z
  502. .locals 13
  503. const/4 v0, 0x1
  504. if-ne p0, p1, :cond_0
  505. return v0
  506. :cond_0
  507. instance-of v1, p1, Lokio/Buffer;
  508. const/4 v2, 0x0
  509. if-nez v1, :cond_1
  510. return v2
  511. :cond_1
  512. check-cast p1, Lokio/Buffer;
  513. iget-wide v3, p0, Lokio/Buffer;->size:J
  514. iget-wide v5, p1, Lokio/Buffer;->size:J
  515. cmp-long v1, v3, v5
  516. if-eqz v1, :cond_2
  517. return v2
  518. :cond_2
  519. const-wide/16 v5, 0x0
  520. cmp-long v1, v3, v5
  521. if-nez v1, :cond_3
  522. return v0
  523. :cond_3
  524. iget-object v1, p0, Lokio/Buffer;->head:Lokio/Segment;
  525. iget-object p1, p1, Lokio/Buffer;->head:Lokio/Segment;
  526. iget v3, v1, Lokio/Segment;->pos:I
  527. iget v4, p1, Lokio/Segment;->pos:I
  528. :goto_0
  529. iget-wide v7, p0, Lokio/Buffer;->size:J
  530. cmp-long v9, v5, v7
  531. if-gez v9, :cond_8
  532. iget v7, v1, Lokio/Segment;->limit:I
  533. sub-int/2addr v7, v3
  534. iget v8, p1, Lokio/Segment;->limit:I
  535. sub-int/2addr v8, v4
  536. invoke-static {v7, v8}, Ljava/lang/Math;->min(II)I
  537. move-result v7
  538. int-to-long v7, v7
  539. move v9, v4
  540. move v4, v3
  541. const/4 v3, 0x0
  542. :goto_1
  543. int-to-long v10, v3
  544. cmp-long v12, v10, v7
  545. if-gez v12, :cond_5
  546. iget-object v10, v1, Lokio/Segment;->data:[B
  547. add-int/lit8 v11, v4, 0x1
  548. aget-byte v4, v10, v4
  549. iget-object v10, p1, Lokio/Segment;->data:[B
  550. add-int/lit8 v12, v9, 0x1
  551. aget-byte v9, v10, v9
  552. if-eq v4, v9, :cond_4
  553. return v2
  554. :cond_4
  555. add-int/lit8 v3, v3, 0x1
  556. move v4, v11
  557. move v9, v12
  558. goto :goto_1
  559. :cond_5
  560. iget v3, v1, Lokio/Segment;->limit:I
  561. if-ne v4, v3, :cond_6
  562. iget-object v1, v1, Lokio/Segment;->next:Lokio/Segment;
  563. iget v3, v1, Lokio/Segment;->pos:I
  564. goto :goto_2
  565. :cond_6
  566. move v3, v4
  567. :goto_2
  568. iget v4, p1, Lokio/Segment;->limit:I
  569. if-ne v9, v4, :cond_7
  570. iget-object p1, p1, Lokio/Segment;->next:Lokio/Segment;
  571. iget v4, p1, Lokio/Segment;->pos:I
  572. goto :goto_3
  573. :cond_7
  574. move v4, v9
  575. :goto_3
  576. add-long/2addr v5, v7
  577. goto :goto_0
  578. :cond_8
  579. return v0
  580. .end method
  581. .method public exhausted()Z
  582. .locals 5
  583. iget-wide v0, p0, Lokio/Buffer;->size:J
  584. const-wide/16 v2, 0x0
  585. cmp-long v4, v0, v2
  586. if-nez v4, :cond_0
  587. const/4 v0, 0x1
  588. goto :goto_0
  589. :cond_0
  590. const/4 v0, 0x0
  591. :goto_0
  592. return v0
  593. .end method
  594. .method public flush()V
  595. .locals 0
  596. return-void
  597. .end method
  598. .method public getByte(J)B
  599. .locals 6
  600. iget-wide v0, p0, Lokio/Buffer;->size:J
  601. const-wide/16 v4, 0x1
  602. move-wide v2, p1
  603. invoke-static/range {v0 .. v5}, Lokio/Util;->checkOffsetAndCount(JJJ)V
  604. iget-object v0, p0, Lokio/Buffer;->head:Lokio/Segment;
  605. :goto_0
  606. iget v1, v0, Lokio/Segment;->limit:I
  607. iget v2, v0, Lokio/Segment;->pos:I
  608. sub-int/2addr v1, v2
  609. int-to-long v3, v1
  610. cmp-long v1, p1, v3
  611. if-gez v1, :cond_0
  612. iget-object v0, v0, Lokio/Segment;->data:[B
  613. long-to-int p2, p1
  614. add-int/2addr v2, p2
  615. aget-byte p1, v0, v2
  616. return p1
  617. :cond_0
  618. sub-long/2addr p1, v3
  619. iget-object v0, v0, Lokio/Segment;->next:Lokio/Segment;
  620. goto :goto_0
  621. .end method
  622. .method public hashCode()I
  623. .locals 5
  624. iget-object v0, p0, Lokio/Buffer;->head:Lokio/Segment;
  625. if-nez v0, :cond_0
  626. const/4 v0, 0x0
  627. return v0
  628. :cond_0
  629. const/4 v1, 0x1
  630. :cond_1
  631. iget v2, v0, Lokio/Segment;->pos:I
  632. iget v3, v0, Lokio/Segment;->limit:I
  633. :goto_0
  634. if-ge v2, v3, :cond_2
  635. mul-int/lit8 v1, v1, 0x1f
  636. iget-object v4, v0, Lokio/Segment;->data:[B
  637. aget-byte v4, v4, v2
  638. add-int/2addr v1, v4
  639. add-int/lit8 v2, v2, 0x1
  640. goto :goto_0
  641. :cond_2
  642. iget-object v0, v0, Lokio/Segment;->next:Lokio/Segment;
  643. iget-object v2, p0, Lokio/Buffer;->head:Lokio/Segment;
  644. if-ne v0, v2, :cond_1
  645. return v1
  646. .end method
  647. .method public hmacSha1(Lokio/ByteString;)Lokio/ByteString;
  648. .locals 1
  649. const-string v0, "HmacSHA1"
  650. invoke-direct {p0, v0, p1}, Lokio/Buffer;->hmac(Ljava/lang/String;Lokio/ByteString;)Lokio/ByteString;
  651. move-result-object p1
  652. return-object p1
  653. .end method
  654. .method public hmacSha256(Lokio/ByteString;)Lokio/ByteString;
  655. .locals 1
  656. const-string v0, "HmacSHA256"
  657. invoke-direct {p0, v0, p1}, Lokio/Buffer;->hmac(Ljava/lang/String;Lokio/ByteString;)Lokio/ByteString;
  658. move-result-object p1
  659. return-object p1
  660. .end method
  661. .method public hmacSha512(Lokio/ByteString;)Lokio/ByteString;
  662. .locals 1
  663. const-string v0, "HmacSHA512"
  664. invoke-direct {p0, v0, p1}, Lokio/Buffer;->hmac(Ljava/lang/String;Lokio/ByteString;)Lokio/ByteString;
  665. move-result-object p1
  666. return-object p1
  667. .end method
  668. .method public indexOf(B)J
  669. .locals 6
  670. const-wide/16 v2, 0x0
  671. const-wide v4, 0x7fffffffffffffffL
  672. move-object v0, p0
  673. move v1, p1
  674. invoke-virtual/range {v0 .. v5}, Lokio/Buffer;->indexOf(BJJ)J
  675. move-result-wide v0
  676. return-wide v0
  677. .end method
  678. .method public indexOf(BJ)J
  679. .locals 6
  680. const-wide v4, 0x7fffffffffffffffL
  681. move-object v0, p0
  682. move v1, p1
  683. move-wide v2, p2
  684. invoke-virtual/range {v0 .. v5}, Lokio/Buffer;->indexOf(BJJ)J
  685. move-result-wide p1
  686. return-wide p1
  687. .end method
  688. .method public indexOf(BJJ)J
  689. .locals 15
  690. move-object v0, p0
  691. const-wide/16 v1, 0x0
  692. cmp-long v3, p2, v1
  693. if-ltz v3, :cond_8
  694. cmp-long v3, p4, p2
  695. if-ltz v3, :cond_8
  696. iget-wide v3, v0, Lokio/Buffer;->size:J
  697. cmp-long v5, p4, v3
  698. if-lez v5, :cond_0
  699. goto :goto_0
  700. :cond_0
  701. move-wide/from16 v3, p4
  702. :goto_0
  703. const-wide/16 v5, -0x1
  704. cmp-long v7, p2, v3
  705. if-nez v7, :cond_1
  706. return-wide v5
  707. :cond_1
  708. iget-object v7, v0, Lokio/Buffer;->head:Lokio/Segment;
  709. if-nez v7, :cond_2
  710. return-wide v5
  711. :cond_2
  712. iget-wide v8, v0, Lokio/Buffer;->size:J
  713. sub-long v10, v8, p2
  714. cmp-long v12, v10, p2
  715. if-gez v12, :cond_3
  716. :goto_1
  717. cmp-long v1, v8, p2
  718. if-lez v1, :cond_4
  719. iget-object v7, v7, Lokio/Segment;->prev:Lokio/Segment;
  720. iget v1, v7, Lokio/Segment;->limit:I
  721. iget v2, v7, Lokio/Segment;->pos:I
  722. sub-int/2addr v1, v2
  723. int-to-long v1, v1
  724. sub-long/2addr v8, v1
  725. goto :goto_1
  726. :cond_3
  727. :goto_2
  728. move-wide v8, v1
  729. iget v1, v7, Lokio/Segment;->limit:I
  730. iget v2, v7, Lokio/Segment;->pos:I
  731. sub-int/2addr v1, v2
  732. int-to-long v1, v1
  733. add-long/2addr v1, v8
  734. cmp-long v10, v1, p2
  735. if-gez v10, :cond_4
  736. iget-object v7, v7, Lokio/Segment;->next:Lokio/Segment;
  737. goto :goto_2
  738. :cond_4
  739. move-wide/from16 v1, p2
  740. :goto_3
  741. cmp-long v10, v8, v3
  742. if-gez v10, :cond_7
  743. iget-object v10, v7, Lokio/Segment;->data:[B
  744. iget v11, v7, Lokio/Segment;->limit:I
  745. int-to-long v11, v11
  746. iget v13, v7, Lokio/Segment;->pos:I
  747. int-to-long v13, v13
  748. add-long/2addr v13, v3
  749. sub-long/2addr v13, v8
  750. invoke-static {v11, v12, v13, v14}, Ljava/lang/Math;->min(JJ)J
  751. move-result-wide v11
  752. long-to-int v12, v11
  753. iget v11, v7, Lokio/Segment;->pos:I
  754. int-to-long v13, v11
  755. add-long/2addr v13, v1
  756. sub-long/2addr v13, v8
  757. long-to-int v1, v13
  758. :goto_4
  759. if-ge v1, v12, :cond_6
  760. aget-byte v2, v10, v1
  761. move/from16 v11, p1
  762. if-ne v2, v11, :cond_5
  763. iget v2, v7, Lokio/Segment;->pos:I
  764. sub-int/2addr v1, v2
  765. int-to-long v1, v1
  766. add-long/2addr v1, v8
  767. return-wide v1
  768. :cond_5
  769. add-int/lit8 v1, v1, 0x1
  770. goto :goto_4
  771. :cond_6
  772. move/from16 v11, p1
  773. iget v1, v7, Lokio/Segment;->limit:I
  774. iget v2, v7, Lokio/Segment;->pos:I
  775. sub-int/2addr v1, v2
  776. int-to-long v1, v1
  777. add-long/2addr v1, v8
  778. iget-object v7, v7, Lokio/Segment;->next:Lokio/Segment;
  779. move-wide v8, v1
  780. goto :goto_3
  781. :cond_7
  782. return-wide v5
  783. :cond_8
  784. new-instance v1, Ljava/lang/IllegalArgumentException;
  785. const/4 v2, 0x3
  786. new-array v2, v2, [Ljava/lang/Object;
  787. const/4 v3, 0x0
  788. iget-wide v4, v0, Lokio/Buffer;->size:J
  789. invoke-static {v4, v5}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
  790. move-result-object v4
  791. aput-object v4, v2, v3
  792. invoke-static/range {p2 .. p3}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
  793. move-result-object v3
  794. const/4 v4, 0x1
  795. aput-object v3, v2, v4
  796. const/4 v3, 0x2
  797. invoke-static/range {p4 .. p5}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
  798. move-result-object v4
  799. aput-object v4, v2, v3
  800. const-string v3, "size=%s fromIndex=%s toIndex=%s"
  801. invoke-static {v3, v2}, Ljava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
  802. move-result-object v2
  803. invoke-direct {v1, v2}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
  804. goto :goto_6
  805. :goto_5
  806. throw v1
  807. :goto_6
  808. goto :goto_5
  809. .end method
  810. .method public indexOf(Lokio/ByteString;)J
  811. .locals 2
  812. .annotation system Ldalvik/annotation/Throws;
  813. value = {
  814. Ljava/io/IOException;
  815. }
  816. .end annotation
  817. const-wide/16 v0, 0x0
  818. invoke-virtual {p0, p1, v0, v1}, Lokio/Buffer;->indexOf(Lokio/ByteString;J)J
  819. move-result-wide v0
  820. return-wide v0
  821. .end method
  822. .method public indexOf(Lokio/ByteString;J)J
  823. .locals 18
  824. .annotation system Ldalvik/annotation/Throws;
  825. value = {
  826. Ljava/io/IOException;
  827. }
  828. .end annotation
  829. move-object/from16 v6, p0
  830. invoke-virtual/range {p1 .. p1}, Lokio/ByteString;->size()I
  831. move-result v0
  832. if-eqz v0, :cond_8
  833. const-wide/16 v0, 0x0
  834. cmp-long v2, p2, v0
  835. if-ltz v2, :cond_7
  836. iget-object v2, v6, Lokio/Buffer;->head:Lokio/Segment;
  837. const-wide/16 v7, -0x1
  838. if-nez v2, :cond_0
  839. return-wide v7
  840. :cond_0
  841. iget-wide v3, v6, Lokio/Buffer;->size:J
  842. sub-long v9, v3, p2
  843. cmp-long v5, v9, p2
  844. if-gez v5, :cond_1
  845. :goto_0
  846. cmp-long v0, v3, p2
  847. if-lez v0, :cond_2
  848. iget-object v2, v2, Lokio/Segment;->prev:Lokio/Segment;
  849. iget v0, v2, Lokio/Segment;->limit:I
  850. iget v1, v2, Lokio/Segment;->pos:I
  851. sub-int/2addr v0, v1
  852. int-to-long v0, v0
  853. sub-long/2addr v3, v0
  854. goto :goto_0
  855. :cond_1
  856. :goto_1
  857. move-wide v3, v0
  858. iget v0, v2, Lokio/Segment;->limit:I
  859. iget v1, v2, Lokio/Segment;->pos:I
  860. sub-int/2addr v0, v1
  861. int-to-long v0, v0
  862. add-long/2addr v0, v3
  863. cmp-long v5, v0, p2
  864. if-gez v5, :cond_2
  865. iget-object v2, v2, Lokio/Segment;->next:Lokio/Segment;
  866. goto :goto_1
  867. :cond_2
  868. const/4 v0, 0x0
  869. move-object/from16 v9, p1
  870. invoke-virtual {v9, v0}, Lokio/ByteString;->getByte(I)B
  871. move-result v10
  872. invoke-virtual/range {p1 .. p1}, Lokio/ByteString;->size()I
  873. move-result v11
  874. iget-wide v0, v6, Lokio/Buffer;->size:J
  875. int-to-long v12, v11
  876. sub-long/2addr v0, v12
  877. const-wide/16 v12, 0x1
  878. add-long/2addr v12, v0
  879. move-wide/from16 v0, p2
  880. move-object v5, v2
  881. move-wide v14, v3
  882. :goto_2
  883. cmp-long v2, v14, v12
  884. if-gez v2, :cond_6
  885. iget-object v4, v5, Lokio/Segment;->data:[B
  886. iget v2, v5, Lokio/Segment;->limit:I
  887. int-to-long v2, v2
  888. iget v7, v5, Lokio/Segment;->pos:I
  889. int-to-long v7, v7
  890. add-long/2addr v7, v12
  891. sub-long/2addr v7, v14
  892. invoke-static {v2, v3, v7, v8}, Ljava/lang/Math;->min(JJ)J
  893. move-result-wide v2
  894. long-to-int v7, v2
  895. iget v2, v5, Lokio/Segment;->pos:I
  896. int-to-long v2, v2
  897. add-long/2addr v2, v0
  898. sub-long/2addr v2, v14
  899. long-to-int v0, v2
  900. move v8, v0
  901. :goto_3
  902. if-ge v8, v7, :cond_5
  903. aget-byte v0, v4, v8
  904. if-ne v0, v10, :cond_3
  905. add-int/lit8 v2, v8, 0x1
  906. const/16 v16, 0x1
  907. move-object/from16 v0, p0
  908. move-object v1, v5
  909. move-object/from16 v3, p1
  910. move-object/from16 v17, v4
  911. move/from16 v4, v16
  912. move-object v6, v5
  913. move v5, v11
  914. invoke-direct/range {v0 .. v5}, Lokio/Buffer;->rangeEquals(Lokio/Segment;ILokio/ByteString;II)Z
  915. move-result v0
  916. if-eqz v0, :cond_4
  917. iget v0, v6, Lokio/Segment;->pos:I
  918. sub-int/2addr v8, v0
  919. int-to-long v0, v8
  920. add-long/2addr v0, v14
  921. return-wide v0
  922. :cond_3
  923. move-object/from16 v17, v4
  924. move-object v6, v5
  925. :cond_4
  926. add-int/lit8 v8, v8, 0x1
  927. move-object v5, v6
  928. move-object/from16 v4, v17
  929. move-object/from16 v6, p0
  930. goto :goto_3
  931. :cond_5
  932. move-object v6, v5
  933. iget v0, v6, Lokio/Segment;->limit:I
  934. iget v1, v6, Lokio/Segment;->pos:I
  935. sub-int/2addr v0, v1
  936. int-to-long v0, v0
  937. add-long/2addr v0, v14
  938. iget-object v5, v6, Lokio/Segment;->next:Lokio/Segment;
  939. const-wide/16 v7, -0x1
  940. move-object/from16 v6, p0
  941. move-wide v14, v0
  942. goto :goto_2
  943. :cond_6
  944. move-wide v0, v7
  945. return-wide v0
  946. :cond_7
  947. new-instance v0, Ljava/lang/IllegalArgumentException;
  948. const-string v1, "fromIndex < 0"
  949. invoke-direct {v0, v1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
  950. throw v0
  951. :cond_8
  952. new-instance v0, Ljava/lang/IllegalArgumentException;
  953. const-string v1, "bytes is empty"
  954. invoke-direct {v0, v1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
  955. goto :goto_5
  956. :goto_4
  957. throw v0
  958. :goto_5
  959. goto :goto_4
  960. .end method
  961. .method public indexOfElement(Lokio/ByteString;)J
  962. .locals 2
  963. const-wide/16 v0, 0x0
  964. invoke-virtual {p0, p1, v0, v1}, Lokio/Buffer;->indexOfElement(Lokio/ByteString;J)J
  965. move-result-wide v0
  966. return-wide v0
  967. .end method
  968. .method public indexOfElement(Lokio/ByteString;J)J
  969. .locals 11
  970. const-wide/16 v0, 0x0
  971. cmp-long v2, p2, v0
  972. if-ltz v2, :cond_b
  973. iget-object v2, p0, Lokio/Buffer;->head:Lokio/Segment;
  974. const-wide/16 v3, -0x1
  975. if-nez v2, :cond_0
  976. return-wide v3
  977. :cond_0
  978. iget-wide v5, p0, Lokio/Buffer;->size:J
  979. sub-long v7, v5, p2
  980. cmp-long v9, v7, p2
  981. if-gez v9, :cond_1
  982. :goto_0
  983. cmp-long v0, v5, p2
  984. if-lez v0, :cond_2
  985. iget-object v2, v2, Lokio/Segment;->prev:Lokio/Segment;
  986. iget v0, v2, Lokio/Segment;->limit:I
  987. iget v1, v2, Lokio/Segment;->pos:I
  988. sub-int/2addr v0, v1
  989. int-to-long v0, v0
  990. sub-long/2addr v5, v0
  991. goto :goto_0
  992. :cond_1
  993. :goto_1
  994. move-wide v5, v0
  995. iget v0, v2, Lokio/Segment;->limit:I
  996. iget v1, v2, Lokio/Segment;->pos:I
  997. sub-int/2addr v0, v1
  998. int-to-long v0, v0
  999. add-long/2addr v0, v5
  1000. cmp-long v7, v0, p2
  1001. if-gez v7, :cond_2
  1002. iget-object v2, v2, Lokio/Segment;->next:Lokio/Segment;
  1003. goto :goto_1
  1004. :cond_2
  1005. invoke-virtual {p1}, Lokio/ByteString;->size()I
  1006. move-result v0
  1007. const/4 v1, 0x2
  1008. const/4 v7, 0x0
  1009. if-ne v0, v1, :cond_6
  1010. invoke-virtual {p1, v7}, Lokio/ByteString;->getByte(I)B
  1011. move-result v0
  1012. const/4 v1, 0x1
  1013. invoke-virtual {p1, v1}, Lokio/ByteString;->getByte(I)B
  1014. move-result p1
  1015. :goto_2
  1016. iget-wide v7, p0, Lokio/Buffer;->size:J
  1017. cmp-long v1, v5, v7
  1018. if-gez v1, :cond_a
  1019. iget-object v1, v2, Lokio/Segment;->data:[B
  1020. iget v7, v2, Lokio/Segment;->pos:I
  1021. int-to-long v7, v7
  1022. add-long/2addr v7, p2
  1023. sub-long/2addr v7, v5
  1024. long-to-int p2, v7
  1025. iget p3, v2, Lokio/Segment;->limit:I
  1026. :goto_3
  1027. if-ge p2, p3, :cond_5
  1028. aget-byte v7, v1, p2
  1029. if-eq v7, v0, :cond_4
  1030. if-ne v7, p1, :cond_3
  1031. goto :goto_4
  1032. :cond_3
  1033. add-int/lit8 p2, p2, 0x1
  1034. goto :goto_3
  1035. :cond_4
  1036. :goto_4
  1037. iget p1, v2, Lokio/Segment;->pos:I
  1038. sub-int/2addr p2, p1
  1039. int-to-long p1, p2
  1040. add-long/2addr p1, v5
  1041. return-wide p1
  1042. :cond_5
  1043. iget p2, v2, Lokio/Segment;->limit:I
  1044. iget p3, v2, Lokio/Segment;->pos:I
  1045. sub-int/2addr p2, p3
  1046. int-to-long p2, p2
  1047. add-long/2addr p2, v5
  1048. iget-object v2, v2, Lokio/Segment;->next:Lokio/Segment;
  1049. move-wide v5, p2
  1050. goto :goto_2
  1051. :cond_6
  1052. invoke-virtual {p1}, Lokio/ByteString;->internalArray()[B
  1053. move-result-object p1
  1054. :goto_5
  1055. iget-wide v0, p0, Lokio/Buffer;->size:J
  1056. cmp-long v8, v5, v0
  1057. if-gez v8, :cond_a
  1058. iget-object v0, v2, Lokio/Segment;->data:[B
  1059. iget v1, v2, Lokio/Segment;->pos:I
  1060. int-to-long v8, v1
  1061. add-long/2addr v8, p2
  1062. sub-long/2addr v8, v5
  1063. long-to-int p2, v8
  1064. iget p3, v2, Lokio/Segment;->limit:I
  1065. :goto_6
  1066. if-ge p2, p3, :cond_9
  1067. aget-byte v1, v0, p2
  1068. array-length v8, p1
  1069. const/4 v9, 0x0
  1070. :goto_7
  1071. if-ge v9, v8, :cond_8
  1072. aget-byte v10, p1, v9
  1073. if-ne v1, v10, :cond_7
  1074. goto :goto_4
  1075. :cond_7
  1076. add-int/lit8 v9, v9, 0x1
  1077. goto :goto_7
  1078. :cond_8
  1079. add-int/lit8 p2, p2, 0x1
  1080. goto :goto_6
  1081. :cond_9
  1082. iget p2, v2, Lokio/Segment;->limit:I
  1083. iget p3, v2, Lokio/Segment;->pos:I
  1084. sub-int/2addr p2, p3
  1085. int-to-long p2, p2
  1086. add-long/2addr p2, v5
  1087. iget-object v2, v2, Lokio/Segment;->next:Lokio/Segment;
  1088. move-wide v5, p2
  1089. goto :goto_5
  1090. :cond_a
  1091. return-wide v3
  1092. :cond_b
  1093. new-instance p1, Ljava/lang/IllegalArgumentException;
  1094. const-string p2, "fromIndex < 0"
  1095. invoke-direct {p1, p2}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
  1096. goto :goto_9
  1097. :goto_8
  1098. throw p1
  1099. :goto_9
  1100. goto :goto_8
  1101. .end method
  1102. .method public inputStream()Ljava/io/InputStream;
  1103. .locals 1
  1104. new-instance v0, Lokio/Buffer$2;
  1105. invoke-direct {v0, p0}, Lokio/Buffer$2;-><init>(Lokio/Buffer;)V
  1106. return-object v0
  1107. .end method
  1108. .method public md5()Lokio/ByteString;
  1109. .locals 1
  1110. const-string v0, "MD5"
  1111. invoke-direct {p0, v0}, Lokio/Buffer;->digest(Ljava/lang/String;)Lokio/ByteString;
  1112. move-result-object v0
  1113. return-object v0
  1114. .end method
  1115. .method public outputStream()Ljava/io/OutputStream;
  1116. .locals 1
  1117. new-instance v0, Lokio/Buffer$1;
  1118. invoke-direct {v0, p0}, Lokio/Buffer$1;-><init>(Lokio/Buffer;)V
  1119. return-object v0
  1120. .end method
  1121. .method public rangeEquals(JLokio/ByteString;)Z
  1122. .locals 6
  1123. invoke-virtual {p3}, Lokio/ByteString;->size()I
  1124. move-result v5
  1125. const/4 v4, 0x0
  1126. move-object v0, p0
  1127. move-wide v1, p1
  1128. move-object v3, p3
  1129. invoke-virtual/range {v0 .. v5}, Lokio/Buffer;->rangeEquals(JLokio/ByteString;II)Z
  1130. move-result p1
  1131. return p1
  1132. .end method
  1133. .method public rangeEquals(JLokio/ByteString;II)Z
  1134. .locals 6
  1135. const/4 v0, 0x0
  1136. const-wide/16 v1, 0x0
  1137. cmp-long v3, p1, v1
  1138. if-ltz v3, :cond_3
  1139. if-ltz p4, :cond_3
  1140. if-ltz p5, :cond_3
  1141. iget-wide v1, p0, Lokio/Buffer;->size:J
  1142. sub-long/2addr v1, p1
  1143. int-to-long v3, p5
  1144. cmp-long v5, v1, v3
  1145. if-ltz v5, :cond_3
  1146. invoke-virtual {p3}, Lokio/ByteString;->size()I
  1147. move-result v1
  1148. sub-int/2addr v1, p4
  1149. if-ge v1, p5, :cond_0
  1150. goto :goto_1
  1151. :cond_0
  1152. const/4 v1, 0x0
  1153. :goto_0
  1154. if-ge v1, p5, :cond_2
  1155. int-to-long v2, v1
  1156. add-long/2addr v2, p1
  1157. invoke-virtual {p0, v2, v3}, Lokio/Buffer;->getByte(J)B
  1158. move-result v2
  1159. add-int v3, p4, v1
  1160. invoke-virtual {p3, v3}, Lokio/ByteString;->getByte(I)B
  1161. move-result v3
  1162. if-eq v2, v3, :cond_1
  1163. return v0
  1164. :cond_1
  1165. add-int/lit8 v1, v1, 0x1
  1166. goto :goto_0
  1167. :cond_2
  1168. const/4 p1, 0x1
  1169. return p1
  1170. :cond_3
  1171. :goto_1
  1172. return v0
  1173. .end method
  1174. .method public read([B)I
  1175. .locals 2
  1176. array-length v0, p1
  1177. const/4 v1, 0x0
  1178. invoke-virtual {p0, p1, v1, v0}, Lokio/Buffer;->read([BII)I
  1179. move-result p1
  1180. return p1
  1181. .end method
  1182. .method public read([BII)I
  1183. .locals 7
  1184. array-length v0, p1
  1185. int-to-long v1, v0
  1186. int-to-long v3, p2
  1187. int-to-long v5, p3
  1188. invoke-static/range {v1 .. v6}, Lokio/Util;->checkOffsetAndCount(JJJ)V
  1189. iget-object v0, p0, Lokio/Buffer;->head:Lokio/Segment;
  1190. if-nez v0, :cond_0
  1191. const/4 p1, -0x1
  1192. return p1
  1193. :cond_0
  1194. iget v1, v0, Lokio/Segment;->limit:I
  1195. iget v2, v0, Lokio/Segment;->pos:I
  1196. sub-int/2addr v1, v2
  1197. invoke-static {p3, v1}, Ljava/lang/Math;->min(II)I
  1198. move-result p3
  1199. iget-object v1, v0, Lokio/Segment;->data:[B
  1200. iget v2, v0, Lokio/Segment;->pos:I
  1201. invoke-static {v1, v2, p1, p2, p3}, Ljava/lang/System;->arraycopy(Ljava/lang/Object;ILjava/lang/Object;II)V
  1202. iget p1, v0, Lokio/Segment;->pos:I
  1203. add-int/2addr p1, p3
  1204. iput p1, v0, Lokio/Segment;->pos:I
  1205. iget-wide p1, p0, Lokio/Buffer;->size:J
  1206. int-to-long v1, p3
  1207. sub-long/2addr p1, v1
  1208. iput-wide p1, p0, Lokio/Buffer;->size:J
  1209. iget p1, v0, Lokio/Segment;->pos:I
  1210. iget p2, v0, Lokio/Segment;->limit:I
  1211. if-ne p1, p2, :cond_1
  1212. invoke-virtual {v0}, Lokio/Segment;->pop()Lokio/Segment;
  1213. move-result-object p1
  1214. iput-object p1, p0, Lokio/Buffer;->head:Lokio/Segment;
  1215. invoke-static {v0}, Lokio/SegmentPool;->recycle(Lokio/Segment;)V
  1216. :cond_1
  1217. return p3
  1218. .end method
  1219. .method public read(Lokio/Buffer;J)J
  1220. .locals 5
  1221. if-eqz p1, :cond_3
  1222. const-wide/16 v0, 0x0
  1223. cmp-long v2, p2, v0
  1224. if-ltz v2, :cond_2
  1225. iget-wide v2, p0, Lokio/Buffer;->size:J
  1226. cmp-long v4, v2, v0
  1227. if-nez v4, :cond_0
  1228. const-wide/16 p1, -0x1
  1229. return-wide p1
  1230. :cond_0
  1231. cmp-long v0, p2, v2
  1232. if-lez v0, :cond_1
  1233. move-wide p2, v2
  1234. :cond_1
  1235. invoke-virtual {p1, p0, p2, p3}, Lokio/Buffer;->write(Lokio/Buffer;J)V
  1236. return-wide p2
  1237. :cond_2
  1238. new-instance p1, Ljava/lang/IllegalArgumentException;
  1239. new-instance v0, Ljava/lang/StringBuilder;
  1240. invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
  1241. const-string v1, "byteCount < 0: "
  1242. invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
  1243. invoke-virtual {v0, p2, p3}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;
  1244. invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
  1245. move-result-object p2
  1246. invoke-direct {p1, p2}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
  1247. throw p1
  1248. :cond_3
  1249. new-instance p1, Ljava/lang/IllegalArgumentException;
  1250. const-string p2, "sink == null"
  1251. invoke-direct {p1, p2}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
  1252. throw p1
  1253. .end method
  1254. .method public readAll(Lokio/Sink;)J
  1255. .locals 5
  1256. .annotation system Ldalvik/annotation/Throws;
  1257. value = {
  1258. Ljava/io/IOException;
  1259. }
  1260. .end annotation
  1261. iget-wide v0, p0, Lokio/Buffer;->size:J
  1262. const-wide/16 v2, 0x0
  1263. cmp-long v4, v0, v2
  1264. if-lez v4, :cond_0
  1265. invoke-interface {p1, p0, v0, v1}, Lokio/Sink;->write(Lokio/Buffer;J)V
  1266. :cond_0
  1267. return-wide v0
  1268. .end method
  1269. .method public readByte()B
  1270. .locals 9
  1271. iget-wide v0, p0, Lokio/Buffer;->size:J
  1272. const-wide/16 v2, 0x0
  1273. cmp-long v4, v0, v2
  1274. if-eqz v4, :cond_1
  1275. iget-object v2, p0, Lokio/Buffer;->head:Lokio/Segment;
  1276. iget v3, v2, Lokio/Segment;->pos:I
  1277. iget v4, v2, Lokio/Segment;->limit:I
  1278. iget-object v5, v2, Lokio/Segment;->data:[B
  1279. add-int/lit8 v6, v3, 0x1
  1280. aget-byte v3, v5, v3
  1281. const-wide/16 v7, 0x1
  1282. sub-long/2addr v0, v7
  1283. iput-wide v0, p0, Lokio/Buffer;->size:J
  1284. if-ne v6, v4, :cond_0
  1285. invoke-virtual {v2}, Lokio/Segment;->pop()Lokio/Segment;
  1286. move-result-object v0
  1287. iput-object v0, p0, Lokio/Buffer;->head:Lokio/Segment;
  1288. invoke-static {v2}, Lokio/SegmentPool;->recycle(Lokio/Segment;)V
  1289. goto :goto_0
  1290. :cond_0
  1291. iput v6, v2, Lokio/Segment;->pos:I
  1292. :goto_0
  1293. return v3
  1294. :cond_1
  1295. new-instance v0, Ljava/lang/IllegalStateException;
  1296. const-string v1, "size == 0"
  1297. invoke-direct {v0, v1}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
  1298. throw v0
  1299. .end method
  1300. .method public readByteArray()[B
  1301. .locals 2
  1302. :try_start_0
  1303. iget-wide v0, p0, Lokio/Buffer;->size:J
  1304. invoke-virtual {p0, v0, v1}, Lokio/Buffer;->readByteArray(J)[B
  1305. move-result-object v0
  1306. :try_end_0
  1307. .catch Ljava/io/EOFException; {:try_start_0 .. :try_end_0} :catch_0
  1308. return-object v0
  1309. :catch_0
  1310. move-exception v0
  1311. new-instance v1, Ljava/lang/AssertionError;
  1312. invoke-direct {v1, v0}, Ljava/lang/AssertionError;-><init>(Ljava/lang/Object;)V
  1313. throw v1
  1314. .end method
  1315. .method public readByteArray(J)[B
  1316. .locals 6
  1317. .annotation system Ldalvik/annotation/Throws;
  1318. value = {
  1319. Ljava/io/EOFException;
  1320. }
  1321. .end annotation
  1322. iget-wide v0, p0, Lokio/Buffer;->size:J
  1323. const-wide/16 v2, 0x0
  1324. move-wide v4, p1
  1325. invoke-static/range {v0 .. v5}, Lokio/Util;->checkOffsetAndCount(JJJ)V
  1326. const-wide/32 v0, 0x7fffffff
  1327. cmp-long v2, p1, v0
  1328. if-gtz v2, :cond_0
  1329. long-to-int p2, p1
  1330. new-array p1, p2, [B
  1331. invoke-virtual {p0, p1}, Lokio/Buffer;->readFully([B)V
  1332. return-object p1
  1333. :cond_0
  1334. new-instance v0, Ljava/lang/IllegalArgumentException;
  1335. new-instance v1, Ljava/lang/StringBuilder;
  1336. invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
  1337. const-string v2, "byteCount > Integer.MAX_VALUE: "
  1338. invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
  1339. invoke-virtual {v1, p1, p2}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;
  1340. invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
  1341. move-result-object p1
  1342. invoke-direct {v0, p1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
  1343. throw v0
  1344. .end method
  1345. .method public readByteString()Lokio/ByteString;
  1346. .locals 2
  1347. new-instance v0, Lokio/ByteString;
  1348. invoke-virtual {p0}, Lokio/Buffer;->readByteArray()[B
  1349. move-result-object v1
  1350. invoke-direct {v0, v1}, Lokio/ByteString;-><init>([B)V
  1351. return-object v0
  1352. .end method
  1353. .method public readByteString(J)Lokio/ByteString;
  1354. .locals 1
  1355. .annotation system Ldalvik/annotation/Throws;
  1356. value = {
  1357. Ljava/io/EOFException;
  1358. }
  1359. .end annotation
  1360. new-instance v0, Lokio/ByteString;
  1361. invoke-virtual {p0, p1, p2}, Lokio/Buffer;->readByteArray(J)[B
  1362. move-result-object p1
  1363. invoke-direct {v0, p1}, Lokio/ByteString;-><init>([B)V
  1364. return-object v0
  1365. .end method
  1366. .method public readDecimalLong()J
  1367. .locals 17
  1368. move-object/from16 v0, p0
  1369. iget-wide v1, v0, Lokio/Buffer;->size:J
  1370. const-wide/16 v3, 0x0
  1371. cmp-long v5, v1, v3
  1372. if-eqz v5, :cond_b
  1373. const-wide/16 v5, -0x7
  1374. const/4 v7, 0x0
  1375. move-wide v8, v5
  1376. const/4 v5, 0x0
  1377. const/4 v6, 0x0
  1378. :cond_0
  1379. iget-object v10, v0, Lokio/Buffer;->head:Lokio/Segment;
  1380. iget-object v11, v10, Lokio/Segment;->data:[B
  1381. iget v12, v10, Lokio/Segment;->pos:I
  1382. iget v13, v10, Lokio/Segment;->limit:I
  1383. :goto_0
  1384. if-ge v12, v13, :cond_7
  1385. aget-byte v15, v11, v12
  1386. const/16 v14, 0x30
  1387. if-lt v15, v14, :cond_4
  1388. const/16 v1, 0x39
  1389. if-gt v15, v1, :cond_4
  1390. sub-int/2addr v14, v15
  1391. const-wide v1, -0xcccccccccccccccL
  1392. cmp-long v16, v3, v1
  1393. if-ltz v16, :cond_2
  1394. cmp-long v16, v3, v1
  1395. if-nez v16, :cond_1
  1396. int-to-long v1, v14
  1397. cmp-long v16, v1, v8
  1398. if-gez v16, :cond_1
  1399. goto :goto_1
  1400. :cond_1
  1401. const-wide/16 v1, 0xa
  1402. mul-long v3, v3, v1
  1403. int-to-long v1, v14
  1404. add-long/2addr v3, v1
  1405. goto :goto_2
  1406. :cond_2
  1407. :goto_1
  1408. new-instance v1, Lokio/Buffer;
  1409. invoke-direct {v1}, Lokio/Buffer;-><init>()V
  1410. invoke-virtual {v1, v3, v4}, Lokio/Buffer;->writeDecimalLong(J)Lokio/Buffer;
  1411. move-result-object v1
  1412. invoke-virtual {v1, v15}, Lokio/Buffer;->writeByte(I)Lokio/Buffer;
  1413. move-result-object v1
  1414. if-nez v5, :cond_3
  1415. invoke-virtual {v1}, Lokio/Buffer;->readByte()B
  1416. :cond_3
  1417. new-instance v2, Ljava/lang/NumberFormatException;
  1418. new-instance v3, Ljava/lang/StringBuilder;
  1419. invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V
  1420. const-string v4, "Number too large: "
  1421. invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
  1422. invoke-virtual {v1}, Lokio/Buffer;->readUtf8()Ljava/lang/String;
  1423. move-result-object v1
  1424. invoke-virtual {v3, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
  1425. invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
  1426. move-result-object v1
  1427. invoke-direct {v2, v1}, Ljava/lang/NumberFormatException;-><init>(Ljava/lang/String;)V
  1428. throw v2
  1429. :cond_4
  1430. const/16 v1, 0x2d
  1431. if-ne v15, v1, :cond_5
  1432. if-nez v7, :cond_5
  1433. const-wide/16 v1, 0x1
  1434. sub-long/2addr v8, v1
  1435. const/4 v5, 0x1
  1436. :goto_2
  1437. add-int/lit8 v12, v12, 0x1
  1438. add-int/lit8 v7, v7, 0x1
  1439. goto :goto_0
  1440. :cond_5
  1441. if-eqz v7, :cond_6
  1442. const/4 v6, 0x1
  1443. goto :goto_3
  1444. :cond_6
  1445. new-instance v1, Ljava/lang/NumberFormatException;
  1446. new-instance v2, Ljava/lang/StringBuilder;
  1447. invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V
  1448. const-string v3, "Expected leading [0-9] or \'-\' character but was 0x"
  1449. invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
  1450. invoke-static {v15}, Ljava/lang/Integer;->toHexString(I)Ljava/lang/String;
  1451. move-result-object v3
  1452. invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
  1453. invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
  1454. move-result-object v2
  1455. invoke-direct {v1, v2}, Ljava/lang/NumberFormatException;-><init>(Ljava/lang/String;)V
  1456. throw v1
  1457. :cond_7
  1458. :goto_3
  1459. if-ne v12, v13, :cond_8
  1460. invoke-virtual {v10}, Lokio/Segment;->pop()Lokio/Segment;
  1461. move-result-object v1
  1462. iput-object v1, v0, Lokio/Buffer;->head:Lokio/Segment;
  1463. invoke-static {v10}, Lokio/SegmentPool;->recycle(Lokio/Segment;)V
  1464. goto :goto_4
  1465. :cond_8
  1466. iput v12, v10, Lokio/Segment;->pos:I
  1467. :goto_4
  1468. if-nez v6, :cond_9
  1469. iget-object v1, v0, Lokio/Buffer;->head:Lokio/Segment;
  1470. if-nez v1, :cond_0
  1471. :cond_9
  1472. iget-wide v1, v0, Lokio/Buffer;->size:J
  1473. int-to-long v6, v7
  1474. sub-long/2addr v1, v6
  1475. iput-wide v1, v0, Lokio/Buffer;->size:J
  1476. if-eqz v5, :cond_a
  1477. goto :goto_5
  1478. :cond_a
  1479. neg-long v3, v3
  1480. :goto_5
  1481. return-wide v3
  1482. :cond_b
  1483. new-instance v1, Ljava/lang/IllegalStateException;
  1484. const-string v2, "size == 0"
  1485. invoke-direct {v1, v2}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
  1486. goto :goto_7
  1487. :goto_6
  1488. throw v1
  1489. :goto_7
  1490. goto :goto_6
  1491. .end method
  1492. .method public readFrom(Ljava/io/InputStream;)Lokio/Buffer;
  1493. .locals 3
  1494. .annotation system Ldalvik/annotation/Throws;
  1495. value = {
  1496. Ljava/io/IOException;
  1497. }
  1498. .end annotation
  1499. const-wide v0, 0x7fffffffffffffffL
  1500. const/4 v2, 0x1
  1501. invoke-direct {p0, p1, v0, v1, v2}, Lokio/Buffer;->readFrom(Ljava/io/InputStream;JZ)V
  1502. return-object p0
  1503. .end method
  1504. .method public readFrom(Ljava/io/InputStream;J)Lokio/Buffer;
  1505. .locals 3
  1506. .annotation system Ldalvik/annotation/Throws;
  1507. value = {
  1508. Ljava/io/IOException;
  1509. }
  1510. .end annotation
  1511. const-wide/16 v0, 0x0
  1512. cmp-long v2, p2, v0
  1513. if-ltz v2, :cond_0
  1514. const/4 v0, 0x0
  1515. invoke-direct {p0, p1, p2, p3, v0}, Lokio/Buffer;->readFrom(Ljava/io/InputStream;JZ)V
  1516. return-object p0
  1517. :cond_0
  1518. new-instance p1, Ljava/lang/IllegalArgumentException;
  1519. new-instance v0, Ljava/lang/StringBuilder;
  1520. invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
  1521. const-string v1, "byteCount < 0: "
  1522. invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
  1523. invoke-virtual {v0, p2, p3}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;
  1524. invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
  1525. move-result-object p2
  1526. invoke-direct {p1, p2}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
  1527. throw p1
  1528. .end method
  1529. .method public readFully(Lokio/Buffer;J)V
  1530. .locals 3
  1531. .annotation system Ldalvik/annotation/Throws;
  1532. value = {
  1533. Ljava/io/EOFException;
  1534. }
  1535. .end annotation
  1536. iget-wide v0, p0, Lokio/Buffer;->size:J
  1537. cmp-long v2, v0, p2
  1538. if-ltz v2, :cond_0
  1539. invoke-virtual {p1, p0, p2, p3}, Lokio/Buffer;->write(Lokio/Buffer;J)V
  1540. return-void
  1541. :cond_0
  1542. invoke-virtual {p1, p0, v0, v1}, Lokio/Buffer;->write(Lokio/Buffer;J)V
  1543. new-instance p1, Ljava/io/EOFException;
  1544. invoke-direct {p1}, Ljava/io/EOFException;-><init>()V
  1545. throw p1
  1546. .end method
  1547. .method public readFully([B)V
  1548. .locals 3
  1549. .annotation system Ldalvik/annotation/Throws;
  1550. value = {
  1551. Ljava/io/EOFException;
  1552. }
  1553. .end annotation
  1554. const/4 v0, 0x0
  1555. :goto_0
  1556. array-length v1, p1
  1557. if-ge v0, v1, :cond_1
  1558. array-length v1, p1
  1559. sub-int/2addr v1, v0
  1560. invoke-virtual {p0, p1, v0, v1}, Lokio/Buffer;->read([BII)I
  1561. move-result v1
  1562. const/4 v2, -0x1
  1563. if-eq v1, v2, :cond_0
  1564. add-int/2addr v0, v1
  1565. goto :goto_0
  1566. :cond_0
  1567. new-instance p1, Ljava/io/EOFException;
  1568. invoke-direct {p1}, Ljava/io/EOFException;-><init>()V
  1569. throw p1
  1570. :cond_1
  1571. return-void
  1572. .end method
  1573. .method public readHexadecimalUnsignedLong()J
  1574. .locals 15
  1575. iget-wide v0, p0, Lokio/Buffer;->size:J
  1576. const-wide/16 v2, 0x0
  1577. cmp-long v4, v0, v2
  1578. if-eqz v4, :cond_9
  1579. const/4 v0, 0x0
  1580. move-wide v4, v2
  1581. const/4 v1, 0x0
  1582. :cond_0
  1583. iget-object v6, p0, Lokio/Buffer;->head:Lokio/Segment;
  1584. iget-object v7, v6, Lokio/Segment;->data:[B
  1585. iget v8, v6, Lokio/Segment;->pos:I
  1586. iget v9, v6, Lokio/Segment;->limit:I
  1587. :goto_0
  1588. if-ge v8, v9, :cond_6
  1589. aget-byte v10, v7, v8
  1590. const/16 v11, 0x30
  1591. if-lt v10, v11, :cond_1
  1592. const/16 v11, 0x39
  1593. if-gt v10, v11, :cond_1
  1594. add-int/lit8 v11, v10, -0x30
  1595. goto :goto_2
  1596. :cond_1
  1597. const/16 v11, 0x61
  1598. if-lt v10, v11, :cond_2
  1599. const/16 v11, 0x66
  1600. if-gt v10, v11, :cond_2
  1601. add-int/lit8 v11, v10, -0x61
  1602. :goto_1
  1603. add-int/lit8 v11, v11, 0xa
  1604. goto :goto_2
  1605. :cond_2
  1606. const/16 v11, 0x41
  1607. if-lt v10, v11, :cond_4
  1608. const/16 v11, 0x46
  1609. if-gt v10, v11, :cond_4
  1610. add-int/lit8 v11, v10, -0x41
  1611. goto :goto_1
  1612. :goto_2
  1613. const-wide/high16 v12, -0x1000000000000000L # -3.105036184601418E231
  1614. and-long/2addr v12, v4
  1615. cmp-long v14, v12, v2
  1616. if-nez v14, :cond_3
  1617. const/4 v10, 0x4
  1618. shl-long/2addr v4, v10
  1619. int-to-long v10, v11
  1620. or-long/2addr v4, v10
  1621. add-int/lit8 v8, v8, 0x1
  1622. add-int/lit8 v1, v1, 0x1
  1623. goto :goto_0
  1624. :cond_3
  1625. new-instance v0, Lokio/Buffer;
  1626. invoke-direct {v0}, Lokio/Buffer;-><init>()V
  1627. invoke-virtual {v0, v4, v5}, Lokio/Buffer;->writeHexadecimalUnsignedLong(J)Lokio/Buffer;
  1628. move-result-object v0
  1629. invoke-virtual {v0, v10}, Lokio/Buffer;->writeByte(I)Lokio/Buffer;
  1630. move-result-object v0
  1631. new-instance v1, Ljava/lang/NumberFormatException;
  1632. new-instance v2, Ljava/lang/StringBuilder;
  1633. invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V
  1634. const-string v3, "Number too large: "
  1635. invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
  1636. invoke-virtual {v0}, Lokio/Buffer;->readUtf8()Ljava/lang/String;
  1637. move-result-object v0
  1638. invoke-virtual {v2, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
  1639. invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
  1640. move-result-object v0
  1641. invoke-direct {v1, v0}, Ljava/lang/NumberFormatException;-><init>(Ljava/lang/String;)V
  1642. throw v1
  1643. :cond_4
  1644. if-eqz v1, :cond_5
  1645. const/4 v0, 0x1
  1646. goto :goto_3
  1647. :cond_5
  1648. new-instance v0, Ljava/lang/NumberFormatException;
  1649. new-instance v1, Ljava/lang/StringBuilder;
  1650. invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
  1651. const-string v2, "Expected leading [0-9a-fA-F] character but was 0x"
  1652. invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
  1653. invoke-static {v10}, Ljava/lang/Integer;->toHexString(I)Ljava/lang/String;
  1654. move-result-object v2
  1655. invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
  1656. invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
  1657. move-result-object v1
  1658. invoke-direct {v0, v1}, Ljava/lang/NumberFormatException;-><init>(Ljava/lang/String;)V
  1659. throw v0
  1660. :cond_6
  1661. :goto_3
  1662. if-ne v8, v9, :cond_7
  1663. invoke-virtual {v6}, Lokio/Segment;->pop()Lokio/Segment;
  1664. move-result-object v7
  1665. iput-object v7, p0, Lokio/Buffer;->head:Lokio/Segment;
  1666. invoke-static {v6}, Lokio/SegmentPool;->recycle(Lokio/Segment;)V
  1667. goto :goto_4
  1668. :cond_7
  1669. iput v8, v6, Lokio/Segment;->pos:I
  1670. :goto_4
  1671. if-nez v0, :cond_8
  1672. iget-object v6, p0, Lokio/Buffer;->head:Lokio/Segment;
  1673. if-nez v6, :cond_0
  1674. :cond_8
  1675. iget-wide v2, p0, Lokio/Buffer;->size:J
  1676. int-to-long v0, v1
  1677. sub-long/2addr v2, v0
  1678. iput-wide v2, p0, Lokio/Buffer;->size:J
  1679. return-wide v4
  1680. :cond_9
  1681. new-instance v0, Ljava/lang/IllegalStateException;
  1682. const-string v1, "size == 0"
  1683. invoke-direct {v0, v1}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
  1684. goto :goto_6
  1685. :goto_5
  1686. throw v0
  1687. :goto_6
  1688. goto :goto_5
  1689. .end method
  1690. .method public readInt()I
  1691. .locals 10
  1692. iget-wide v0, p0, Lokio/Buffer;->size:J
  1693. const-wide/16 v2, 0x4
  1694. cmp-long v4, v0, v2
  1695. if-ltz v4, :cond_2
  1696. iget-object v4, p0, Lokio/Buffer;->head:Lokio/Segment;
  1697. iget v5, v4, Lokio/Segment;->pos:I
  1698. iget v6, v4, Lokio/Segment;->limit:I
  1699. sub-int v7, v6, v5
  1700. const/4 v8, 0x4
  1701. if-ge v7, v8, :cond_0
  1702. invoke-virtual {p0}, Lokio/Buffer;->readByte()B
  1703. move-result v0
  1704. and-int/lit16 v0, v0, 0xff
  1705. shl-int/lit8 v0, v0, 0x18
  1706. invoke-virtual {p0}, Lokio/Buffer;->readByte()B
  1707. move-result v1
  1708. and-int/lit16 v1, v1, 0xff
  1709. shl-int/lit8 v1, v1, 0x10
  1710. or-int/2addr v0, v1
  1711. invoke-virtual {p0}, Lokio/Buffer;->readByte()B
  1712. move-result v1
  1713. and-int/lit16 v1, v1, 0xff
  1714. shl-int/lit8 v1, v1, 0x8
  1715. or-int/2addr v0, v1
  1716. invoke-virtual {p0}, Lokio/Buffer;->readByte()B
  1717. move-result v1
  1718. and-int/lit16 v1, v1, 0xff
  1719. or-int/2addr v0, v1
  1720. return v0
  1721. :cond_0
  1722. iget-object v7, v4, Lokio/Segment;->data:[B
  1723. add-int/lit8 v8, v5, 0x1
  1724. aget-byte v5, v7, v5
  1725. and-int/lit16 v5, v5, 0xff
  1726. shl-int/lit8 v5, v5, 0x18
  1727. add-int/lit8 v9, v8, 0x1
  1728. aget-byte v8, v7, v8
  1729. and-int/lit16 v8, v8, 0xff
  1730. shl-int/lit8 v8, v8, 0x10
  1731. or-int/2addr v5, v8
  1732. add-int/lit8 v8, v9, 0x1
  1733. aget-byte v9, v7, v9
  1734. and-int/lit16 v9, v9, 0xff
  1735. shl-int/lit8 v9, v9, 0x8
  1736. or-int/2addr v5, v9
  1737. add-int/lit8 v9, v8, 0x1
  1738. aget-byte v7, v7, v8
  1739. and-int/lit16 v7, v7, 0xff
  1740. or-int/2addr v5, v7
  1741. sub-long/2addr v0, v2
  1742. iput-wide v0, p0, Lokio/Buffer;->size:J
  1743. if-ne v9, v6, :cond_1
  1744. invoke-virtual {v4}, Lokio/Segment;->pop()Lokio/Segment;
  1745. move-result-object v0
  1746. iput-object v0, p0, Lokio/Buffer;->head:Lokio/Segment;
  1747. invoke-static {v4}, Lokio/SegmentPool;->recycle(Lokio/Segment;)V
  1748. goto :goto_0
  1749. :cond_1
  1750. iput v9, v4, Lokio/Segment;->pos:I
  1751. :goto_0
  1752. return v5
  1753. :cond_2
  1754. new-instance v0, Ljava/lang/IllegalStateException;
  1755. new-instance v1, Ljava/lang/StringBuilder;
  1756. invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
  1757. const-string v2, "size < 4: "
  1758. invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
  1759. iget-wide v2, p0, Lokio/Buffer;->size:J
  1760. invoke-virtual {v1, v2, v3}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;
  1761. invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
  1762. move-result-object v1
  1763. invoke-direct {v0, v1}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
  1764. throw v0
  1765. .end method
  1766. .method public readIntLe()I
  1767. .locals 1
  1768. invoke-virtual {p0}, Lokio/Buffer;->readInt()I
  1769. move-result v0
  1770. invoke-static {v0}, Lokio/Util;->reverseBytesInt(I)I
  1771. move-result v0
  1772. return v0
  1773. .end method
  1774. .method public readLong()J
  1775. .locals 16
  1776. move-object/from16 v0, p0
  1777. iget-wide v1, v0, Lokio/Buffer;->size:J
  1778. const-wide/16 v3, 0x8
  1779. cmp-long v5, v1, v3
  1780. if-ltz v5, :cond_2
  1781. iget-object v5, v0, Lokio/Buffer;->head:Lokio/Segment;
  1782. iget v6, v5, Lokio/Segment;->pos:I
  1783. iget v7, v5, Lokio/Segment;->limit:I
  1784. sub-int v8, v7, v6
  1785. const/16 v9, 0x20
  1786. const/16 v10, 0x8
  1787. if-ge v8, v10, :cond_0
  1788. invoke-virtual/range {p0 .. p0}, Lokio/Buffer;->readInt()I
  1789. move-result v1
  1790. int-to-long v1, v1
  1791. const-wide v3, 0xffffffffL
  1792. and-long/2addr v1, v3
  1793. shl-long/2addr v1, v9
  1794. invoke-virtual/range {p0 .. p0}, Lokio/Buffer;->readInt()I
  1795. move-result v5
  1796. int-to-long v5, v5
  1797. and-long/2addr v3, v5
  1798. or-long/2addr v1, v3
  1799. return-wide v1
  1800. :cond_0
  1801. iget-object v8, v5, Lokio/Segment;->data:[B
  1802. add-int/lit8 v11, v6, 0x1
  1803. aget-byte v6, v8, v6
  1804. int-to-long v12, v6
  1805. const-wide/16 v14, 0xff
  1806. and-long/2addr v12, v14
  1807. const/16 v6, 0x38
  1808. shl-long/2addr v12, v6
  1809. add-int/lit8 v6, v11, 0x1
  1810. aget-byte v11, v8, v11
  1811. int-to-long v3, v11
  1812. and-long/2addr v3, v14
  1813. const/16 v11, 0x30
  1814. shl-long/2addr v3, v11
  1815. or-long/2addr v3, v12
  1816. add-int/lit8 v11, v6, 0x1
  1817. aget-byte v6, v8, v6
  1818. int-to-long v12, v6
  1819. and-long/2addr v12, v14
  1820. const/16 v6, 0x28
  1821. shl-long/2addr v12, v6
  1822. or-long/2addr v3, v12
  1823. add-int/lit8 v6, v11, 0x1
  1824. aget-byte v11, v8, v11
  1825. int-to-long v11, v11
  1826. and-long/2addr v11, v14
  1827. shl-long/2addr v11, v9
  1828. or-long/2addr v3, v11
  1829. add-int/lit8 v9, v6, 0x1
  1830. aget-byte v6, v8, v6
  1831. int-to-long v11, v6
  1832. and-long/2addr v11, v14
  1833. const/16 v6, 0x18
  1834. shl-long/2addr v11, v6
  1835. or-long/2addr v3, v11
  1836. add-int/lit8 v6, v9, 0x1
  1837. aget-byte v9, v8, v9
  1838. int-to-long v11, v9
  1839. and-long/2addr v11, v14
  1840. const/16 v9, 0x10
  1841. shl-long/2addr v11, v9
  1842. or-long/2addr v3, v11
  1843. add-int/lit8 v9, v6, 0x1
  1844. aget-byte v6, v8, v6
  1845. int-to-long v11, v6
  1846. and-long/2addr v11, v14
  1847. shl-long v10, v11, v10
  1848. or-long/2addr v3, v10
  1849. add-int/lit8 v6, v9, 0x1
  1850. aget-byte v8, v8, v9
  1851. int-to-long v8, v8
  1852. and-long/2addr v8, v14
  1853. or-long/2addr v3, v8
  1854. const-wide/16 v8, 0x8
  1855. sub-long/2addr v1, v8
  1856. iput-wide v1, v0, Lokio/Buffer;->size:J
  1857. if-ne v6, v7, :cond_1
  1858. invoke-virtual {v5}, Lokio/Segment;->pop()Lokio/Segment;
  1859. move-result-object v1
  1860. iput-object v1, v0, Lokio/Buffer;->head:Lokio/Segment;
  1861. invoke-static {v5}, Lokio/SegmentPool;->recycle(Lokio/Segment;)V
  1862. goto :goto_0
  1863. :cond_1
  1864. iput v6, v5, Lokio/Segment;->pos:I
  1865. :goto_0
  1866. return-wide v3
  1867. :cond_2
  1868. new-instance v1, Ljava/lang/IllegalStateException;
  1869. new-instance v2, Ljava/lang/StringBuilder;
  1870. invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V
  1871. const-string v3, "size < 8: "
  1872. invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
  1873. iget-wide v3, v0, Lokio/Buffer;->size:J
  1874. invoke-virtual {v2, v3, v4}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;
  1875. invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
  1876. move-result-object v2
  1877. invoke-direct {v1, v2}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
  1878. throw v1
  1879. .end method
  1880. .method public readLongLe()J
  1881. .locals 2
  1882. invoke-virtual {p0}, Lokio/Buffer;->readLong()J
  1883. move-result-wide v0
  1884. invoke-static {v0, v1}, Lokio/Util;->reverseBytesLong(J)J
  1885. move-result-wide v0
  1886. return-wide v0
  1887. .end method
  1888. .method public readShort()S
  1889. .locals 10
  1890. iget-wide v0, p0, Lokio/Buffer;->size:J
  1891. const-wide/16 v2, 0x2
  1892. cmp-long v4, v0, v2
  1893. if-ltz v4, :cond_2
  1894. iget-object v4, p0, Lokio/Buffer;->head:Lokio/Segment;
  1895. iget v5, v4, Lokio/Segment;->pos:I
  1896. iget v6, v4, Lokio/Segment;->limit:I
  1897. sub-int v7, v6, v5
  1898. const/4 v8, 0x2
  1899. if-ge v7, v8, :cond_0
  1900. invoke-virtual {p0}, Lokio/Buffer;->readByte()B
  1901. move-result v0
  1902. and-int/lit16 v0, v0, 0xff
  1903. shl-int/lit8 v0, v0, 0x8
  1904. invoke-virtual {p0}, Lokio/Buffer;->readByte()B
  1905. move-result v1
  1906. and-int/lit16 v1, v1, 0xff
  1907. or-int/2addr v0, v1
  1908. int-to-short v0, v0
  1909. return v0
  1910. :cond_0
  1911. iget-object v7, v4, Lokio/Segment;->data:[B
  1912. add-int/lit8 v8, v5, 0x1
  1913. aget-byte v5, v7, v5
  1914. and-int/lit16 v5, v5, 0xff
  1915. shl-int/lit8 v5, v5, 0x8
  1916. add-int/lit8 v9, v8, 0x1
  1917. aget-byte v7, v7, v8
  1918. and-int/lit16 v7, v7, 0xff
  1919. or-int/2addr v5, v7
  1920. sub-long/2addr v0, v2
  1921. iput-wide v0, p0, Lokio/Buffer;->size:J
  1922. if-ne v9, v6, :cond_1
  1923. invoke-virtual {v4}, Lokio/Segment;->pop()Lokio/Segment;
  1924. move-result-object v0
  1925. iput-object v0, p0, Lokio/Buffer;->head:Lokio/Segment;
  1926. invoke-static {v4}, Lokio/SegmentPool;->recycle(Lokio/Segment;)V
  1927. goto :goto_0
  1928. :cond_1
  1929. iput v9, v4, Lokio/Segment;->pos:I
  1930. :goto_0
  1931. int-to-short v0, v5
  1932. return v0
  1933. :cond_2
  1934. new-instance v0, Ljava/lang/IllegalStateException;
  1935. new-instance v1, Ljava/lang/StringBuilder;
  1936. invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
  1937. const-string v2, "size < 2: "
  1938. invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
  1939. iget-wide v2, p0, Lokio/Buffer;->size:J
  1940. invoke-virtual {v1, v2, v3}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;
  1941. invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
  1942. move-result-object v1
  1943. invoke-direct {v0, v1}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
  1944. throw v0
  1945. .end method
  1946. .method public readShortLe()S
  1947. .locals 1
  1948. invoke-virtual {p0}, Lokio/Buffer;->readShort()S
  1949. move-result v0
  1950. invoke-static {v0}, Lokio/Util;->reverseBytesShort(S)S
  1951. move-result v0
  1952. return v0
  1953. .end method
  1954. .method public readString(JLjava/nio/charset/Charset;)Ljava/lang/String;
  1955. .locals 7
  1956. .annotation system Ldalvik/annotation/Throws;
  1957. value = {
  1958. Ljava/io/EOFException;
  1959. }
  1960. .end annotation
  1961. iget-wide v0, p0, Lokio/Buffer;->size:J
  1962. const-wide/16 v2, 0x0
  1963. move-wide v4, p1
  1964. invoke-static/range {v0 .. v5}, Lokio/Util;->checkOffsetAndCount(JJJ)V
  1965. if-eqz p3, :cond_4
  1966. const-wide/32 v0, 0x7fffffff
  1967. cmp-long v2, p1, v0
  1968. if-gtz v2, :cond_3
  1969. const-wide/16 v0, 0x0
  1970. cmp-long v2, p1, v0
  1971. if-nez v2, :cond_0
  1972. const-string p1, ""
  1973. return-object p1
  1974. :cond_0
  1975. iget-object v0, p0, Lokio/Buffer;->head:Lokio/Segment;
  1976. iget v1, v0, Lokio/Segment;->pos:I
  1977. int-to-long v2, v1
  1978. add-long/2addr v2, p1
  1979. iget v4, v0, Lokio/Segment;->limit:I
  1980. int-to-long v4, v4
  1981. cmp-long v6, v2, v4
  1982. if-lez v6, :cond_1
  1983. new-instance v0, Ljava/lang/String;
  1984. invoke-virtual {p0, p1, p2}, Lokio/Buffer;->readByteArray(J)[B
  1985. move-result-object p1
  1986. invoke-direct {v0, p1, p3}, Ljava/lang/String;-><init>([BLjava/nio/charset/Charset;)V
  1987. return-object v0
  1988. :cond_1
  1989. new-instance v2, Ljava/lang/String;
  1990. iget-object v3, v0, Lokio/Segment;->data:[B
  1991. long-to-int v4, p1
  1992. invoke-direct {v2, v3, v1, v4, p3}, Ljava/lang/String;-><init>([BIILjava/nio/charset/Charset;)V
  1993. iget p3, v0, Lokio/Segment;->pos:I
  1994. int-to-long v3, p3
  1995. add-long/2addr v3, p1
  1996. long-to-int p3, v3
  1997. iput p3, v0, Lokio/Segment;->pos:I
  1998. iget-wide v3, p0, Lokio/Buffer;->size:J
  1999. sub-long/2addr v3, p1
  2000. iput-wide v3, p0, Lokio/Buffer;->size:J
  2001. iget p1, v0, Lokio/Segment;->pos:I
  2002. iget p2, v0, Lokio/Segment;->limit:I
  2003. if-ne p1, p2, :cond_2
  2004. invoke-virtual {v0}, Lokio/Segment;->pop()Lokio/Segment;
  2005. move-result-object p1
  2006. iput-object p1, p0, Lokio/Buffer;->head:Lokio/Segment;
  2007. invoke-static {v0}, Lokio/SegmentPool;->recycle(Lokio/Segment;)V
  2008. :cond_2
  2009. return-object v2
  2010. :cond_3
  2011. new-instance p3, Ljava/lang/IllegalArgumentException;
  2012. new-instance v0, Ljava/lang/StringBuilder;
  2013. invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
  2014. const-string v1, "byteCount > Integer.MAX_VALUE: "
  2015. invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
  2016. invoke-virtual {v0, p1, p2}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;
  2017. invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
  2018. move-result-object p1
  2019. invoke-direct {p3, p1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
  2020. throw p3
  2021. :cond_4
  2022. new-instance p1, Ljava/lang/IllegalArgumentException;
  2023. const-string p2, "charset == null"
  2024. invoke-direct {p1, p2}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
  2025. throw p1
  2026. .end method
  2027. .method public readString(Ljava/nio/charset/Charset;)Ljava/lang/String;
  2028. .locals 2
  2029. :try_start_0
  2030. iget-wide v0, p0, Lokio/Buffer;->size:J
  2031. invoke-virtual {p0, v0, v1, p1}, Lokio/Buffer;->readString(JLjava/nio/charset/Charset;)Ljava/lang/String;
  2032. move-result-object p1
  2033. :try_end_0
  2034. .catch Ljava/io/EOFException; {:try_start_0 .. :try_end_0} :catch_0
  2035. return-object p1
  2036. :catch_0
  2037. move-exception p1
  2038. new-instance v0, Ljava/lang/AssertionError;
  2039. invoke-direct {v0, p1}, Ljava/lang/AssertionError;-><init>(Ljava/lang/Object;)V
  2040. throw v0
  2041. .end method
  2042. .method public readUtf8()Ljava/lang/String;
  2043. .locals 3
  2044. :try_start_0
  2045. iget-wide v0, p0, Lokio/Buffer;->size:J
  2046. sget-object v2, Lokio/Util;->UTF_8:Ljava/nio/charset/Charset;
  2047. invoke-virtual {p0, v0, v1, v2}, Lokio/Buffer;->readString(JLjava/nio/charset/Charset;)Ljava/lang/String;
  2048. move-result-object v0
  2049. :try_end_0
  2050. .catch Ljava/io/EOFException; {:try_start_0 .. :try_end_0} :catch_0
  2051. return-object v0
  2052. :catch_0
  2053. move-exception v0
  2054. new-instance v1, Ljava/lang/AssertionError;
  2055. invoke-direct {v1, v0}, Ljava/lang/AssertionError;-><init>(Ljava/lang/Object;)V
  2056. throw v1
  2057. .end method
  2058. .method public readUtf8(J)Ljava/lang/String;
  2059. .locals 1
  2060. .annotation system Ldalvik/annotation/Throws;
  2061. value = {
  2062. Ljava/io/EOFException;
  2063. }
  2064. .end annotation
  2065. sget-object v0, Lokio/Util;->UTF_8:Ljava/nio/charset/Charset;
  2066. invoke-virtual {p0, p1, p2, v0}, Lokio/Buffer;->readString(JLjava/nio/charset/Charset;)Ljava/lang/String;
  2067. move-result-object p1
  2068. return-object p1
  2069. .end method
  2070. .method public readUtf8CodePoint()I
  2071. .locals 12
  2072. .annotation system Ldalvik/annotation/Throws;
  2073. value = {
  2074. Ljava/io/EOFException;
  2075. }
  2076. .end annotation
  2077. iget-wide v0, p0, Lokio/Buffer;->size:J
  2078. const-wide/16 v2, 0x0
  2079. cmp-long v4, v0, v2
  2080. if-eqz v4, :cond_a
  2081. invoke-virtual {p0, v2, v3}, Lokio/Buffer;->getByte(J)B
  2082. move-result v0
  2083. and-int/lit16 v1, v0, 0x80
  2084. const/4 v2, 0x1
  2085. const/16 v3, 0x80
  2086. const v4, 0xfffd
  2087. if-nez v1, :cond_0
  2088. and-int/lit8 v1, v0, 0x7f
  2089. const/4 v5, 0x0
  2090. const/4 v5, 0x1
  2091. const/4 v6, 0x0
  2092. goto :goto_0
  2093. :cond_0
  2094. and-int/lit16 v1, v0, 0xe0
  2095. const/16 v5, 0xc0
  2096. if-ne v1, v5, :cond_1
  2097. and-int/lit8 v1, v0, 0x1f
  2098. const/4 v5, 0x2
  2099. const/16 v6, 0x80
  2100. goto :goto_0
  2101. :cond_1
  2102. and-int/lit16 v1, v0, 0xf0
  2103. const/16 v5, 0xe0
  2104. if-ne v1, v5, :cond_2
  2105. and-int/lit8 v1, v0, 0xf
  2106. const/4 v5, 0x3
  2107. const/16 v6, 0x800
  2108. goto :goto_0
  2109. :cond_2
  2110. and-int/lit16 v1, v0, 0xf8
  2111. const/16 v5, 0xf0
  2112. if-ne v1, v5, :cond_9
  2113. and-int/lit8 v1, v0, 0x7
  2114. const/4 v5, 0x4
  2115. const/high16 v6, 0x10000
  2116. :goto_0
  2117. iget-wide v7, p0, Lokio/Buffer;->size:J
  2118. int-to-long v9, v5
  2119. cmp-long v11, v7, v9
  2120. if-ltz v11, :cond_8
  2121. :goto_1
  2122. if-ge v2, v5, :cond_4
  2123. int-to-long v7, v2
  2124. invoke-virtual {p0, v7, v8}, Lokio/Buffer;->getByte(J)B
  2125. move-result v0
  2126. and-int/lit16 v11, v0, 0xc0
  2127. if-ne v11, v3, :cond_3
  2128. shl-int/lit8 v1, v1, 0x6
  2129. and-int/lit8 v0, v0, 0x3f
  2130. or-int/2addr v1, v0
  2131. add-int/lit8 v2, v2, 0x1
  2132. goto :goto_1
  2133. :cond_3
  2134. invoke-virtual {p0, v7, v8}, Lokio/Buffer;->skip(J)V
  2135. return v4
  2136. :cond_4
  2137. invoke-virtual {p0, v9, v10}, Lokio/Buffer;->skip(J)V
  2138. const v0, 0x10ffff
  2139. if-le v1, v0, :cond_5
  2140. return v4
  2141. :cond_5
  2142. const v0, 0xd800
  2143. if-lt v1, v0, :cond_6
  2144. const v0, 0xdfff
  2145. if-gt v1, v0, :cond_6
  2146. return v4
  2147. :cond_6
  2148. if-ge v1, v6, :cond_7
  2149. return v4
  2150. :cond_7
  2151. return v1
  2152. :cond_8
  2153. new-instance v1, Ljava/io/EOFException;
  2154. new-instance v2, Ljava/lang/StringBuilder;
  2155. invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V
  2156. const-string v3, "size < "
  2157. invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
  2158. invoke-virtual {v2, v5}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
  2159. const-string v3, ": "
  2160. invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
  2161. iget-wide v3, p0, Lokio/Buffer;->size:J
  2162. invoke-virtual {v2, v3, v4}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;
  2163. const-string v3, " (to read code point prefixed 0x"
  2164. invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
  2165. invoke-static {v0}, Ljava/lang/Integer;->toHexString(I)Ljava/lang/String;
  2166. move-result-object v0
  2167. invoke-virtual {v2, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
  2168. const-string v0, ")"
  2169. invoke-virtual {v2, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
  2170. invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
  2171. move-result-object v0
  2172. invoke-direct {v1, v0}, Ljava/io/EOFException;-><init>(Ljava/lang/String;)V
  2173. throw v1
  2174. :cond_9
  2175. const-wide/16 v0, 0x1
  2176. invoke-virtual {p0, v0, v1}, Lokio/Buffer;->skip(J)V
  2177. return v4
  2178. :cond_a
  2179. new-instance v0, Ljava/io/EOFException;
  2180. invoke-direct {v0}, Ljava/io/EOFException;-><init>()V
  2181. goto :goto_3
  2182. :goto_2
  2183. throw v0
  2184. :goto_3
  2185. goto :goto_2
  2186. .end method
  2187. .method public readUtf8Line()Ljava/lang/String;
  2188. .locals 5
  2189. .annotation system Ldalvik/annotation/Throws;
  2190. value = {
  2191. Ljava/io/EOFException;
  2192. }
  2193. .end annotation
  2194. const/16 v0, 0xa
  2195. invoke-virtual {p0, v0}, Lokio/Buffer;->indexOf(B)J
  2196. move-result-wide v0
  2197. const-wide/16 v2, -0x1
  2198. cmp-long v4, v0, v2
  2199. if-nez v4, :cond_1
  2200. iget-wide v0, p0, Lokio/Buffer;->size:J
  2201. const-wide/16 v2, 0x0
  2202. cmp-long v4, v0, v2
  2203. if-eqz v4, :cond_0
  2204. invoke-virtual {p0, v0, v1}, Lokio/Buffer;->readUtf8(J)Ljava/lang/String;
  2205. move-result-object v0
  2206. goto :goto_0
  2207. :cond_0
  2208. const/4 v0, 0x0
  2209. :goto_0
  2210. return-object v0
  2211. :cond_1
  2212. invoke-virtual {p0, v0, v1}, Lokio/Buffer;->readUtf8Line(J)Ljava/lang/String;
  2213. move-result-object v0
  2214. return-object v0
  2215. .end method
  2216. .method readUtf8Line(J)Ljava/lang/String;
  2217. .locals 6
  2218. .annotation system Ldalvik/annotation/Throws;
  2219. value = {
  2220. Ljava/io/EOFException;
  2221. }
  2222. .end annotation
  2223. const-wide/16 v0, 0x1
  2224. const-wide/16 v2, 0x0
  2225. cmp-long v4, p1, v2
  2226. if-lez v4, :cond_0
  2227. sub-long v2, p1, v0
  2228. invoke-virtual {p0, v2, v3}, Lokio/Buffer;->getByte(J)B
  2229. move-result v4
  2230. const/16 v5, 0xd
  2231. if-ne v4, v5, :cond_0
  2232. invoke-virtual {p0, v2, v3}, Lokio/Buffer;->readUtf8(J)Ljava/lang/String;
  2233. move-result-object p1
  2234. const-wide/16 v0, 0x2
  2235. :goto_0
  2236. invoke-virtual {p0, v0, v1}, Lokio/Buffer;->skip(J)V
  2237. return-object p1
  2238. :cond_0
  2239. invoke-virtual {p0, p1, p2}, Lokio/Buffer;->readUtf8(J)Ljava/lang/String;
  2240. move-result-object p1
  2241. goto :goto_0
  2242. .end method
  2243. .method public readUtf8LineStrict()Ljava/lang/String;
  2244. .locals 2
  2245. .annotation system Ldalvik/annotation/Throws;
  2246. value = {
  2247. Ljava/io/EOFException;
  2248. }
  2249. .end annotation
  2250. const-wide v0, 0x7fffffffffffffffL
  2251. invoke-virtual {p0, v0, v1}, Lokio/Buffer;->readUtf8LineStrict(J)Ljava/lang/String;
  2252. move-result-object v0
  2253. return-object v0
  2254. .end method
  2255. .method public readUtf8LineStrict(J)Ljava/lang/String;
  2256. .locals 10
  2257. .annotation system Ldalvik/annotation/Throws;
  2258. value = {
  2259. Ljava/io/EOFException;
  2260. }
  2261. .end annotation
  2262. const-wide/16 v0, 0x0
  2263. cmp-long v2, p1, v0
  2264. if-ltz v2, :cond_3
  2265. const-wide/16 v0, 0x1
  2266. const-wide v2, 0x7fffffffffffffffL
  2267. cmp-long v4, p1, v2
  2268. if-nez v4, :cond_0
  2269. goto :goto_0
  2270. :cond_0
  2271. add-long v2, p1, v0
  2272. :goto_0
  2273. const/16 v5, 0xa
  2274. const-wide/16 v6, 0x0
  2275. move-object v4, p0
  2276. move-wide v8, v2
  2277. invoke-virtual/range {v4 .. v9}, Lokio/Buffer;->indexOf(BJJ)J
  2278. move-result-wide v4
  2279. const-wide/16 v6, -0x1
  2280. cmp-long v8, v4, v6
  2281. if-eqz v8, :cond_1
  2282. invoke-virtual {p0, v4, v5}, Lokio/Buffer;->readUtf8Line(J)Ljava/lang/String;
  2283. move-result-object p1
  2284. return-object p1
  2285. :cond_1
  2286. invoke-virtual {p0}, Lokio/Buffer;->size()J
  2287. move-result-wide v4
  2288. cmp-long v6, v2, v4
  2289. if-gez v6, :cond_2
  2290. sub-long v0, v2, v0
  2291. invoke-virtual {p0, v0, v1}, Lokio/Buffer;->getByte(J)B
  2292. move-result v0
  2293. const/16 v1, 0xd
  2294. if-ne v0, v1, :cond_2
  2295. invoke-virtual {p0, v2, v3}, Lokio/Buffer;->getByte(J)B
  2296. move-result v0
  2297. const/16 v1, 0xa
  2298. if-ne v0, v1, :cond_2
  2299. invoke-virtual {p0, v2, v3}, Lokio/Buffer;->readUtf8Line(J)Ljava/lang/String;
  2300. move-result-object p1
  2301. return-object p1
  2302. :cond_2
  2303. new-instance v6, Lokio/Buffer;
  2304. invoke-direct {v6}, Lokio/Buffer;-><init>()V
  2305. const-wide/16 v2, 0x0
  2306. const-wide/16 v0, 0x20
  2307. invoke-virtual {p0}, Lokio/Buffer;->size()J
  2308. move-result-wide v4
  2309. invoke-static {v0, v1, v4, v5}, Ljava/lang/Math;->min(JJ)J
  2310. move-result-wide v4
  2311. move-object v0, p0
  2312. move-object v1, v6
  2313. invoke-virtual/range {v0 .. v5}, Lokio/Buffer;->copyTo(Lokio/Buffer;JJ)Lokio/Buffer;
  2314. new-instance v0, Ljava/io/EOFException;
  2315. new-instance v1, Ljava/lang/StringBuilder;
  2316. invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
  2317. const-string v2, "\\n not found: limit="
  2318. invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
  2319. invoke-virtual {p0}, Lokio/Buffer;->size()J
  2320. move-result-wide v2
  2321. invoke-static {v2, v3, p1, p2}, Ljava/lang/Math;->min(JJ)J
  2322. move-result-wide p1
  2323. invoke-virtual {v1, p1, p2}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;
  2324. const-string p1, " content="
  2325. invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
  2326. invoke-virtual {v6}, Lokio/Buffer;->readByteString()Lokio/ByteString;
  2327. move-result-object p1
  2328. invoke-virtual {p1}, Lokio/ByteString;->hex()Ljava/lang/String;
  2329. move-result-object p1
  2330. invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
  2331. const/16 p1, 0x2026
  2332. invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder;
  2333. invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
  2334. move-result-object p1
  2335. invoke-direct {v0, p1}, Ljava/io/EOFException;-><init>(Ljava/lang/String;)V
  2336. throw v0
  2337. :cond_3
  2338. new-instance v0, Ljava/lang/IllegalArgumentException;
  2339. new-instance v1, Ljava/lang/StringBuilder;
  2340. invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
  2341. const-string v2, "limit < 0: "
  2342. invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
  2343. invoke-virtual {v1, p1, p2}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;
  2344. invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
  2345. move-result-object p1
  2346. invoke-direct {v0, p1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
  2347. throw v0
  2348. .end method
  2349. .method public request(J)Z
  2350. .locals 3
  2351. iget-wide v0, p0, Lokio/Buffer;->size:J
  2352. cmp-long v2, v0, p1
  2353. if-ltz v2, :cond_0
  2354. const/4 p1, 0x1
  2355. goto :goto_0
  2356. :cond_0
  2357. const/4 p1, 0x0
  2358. :goto_0
  2359. return p1
  2360. .end method
  2361. .method public require(J)V
  2362. .locals 3
  2363. .annotation system Ldalvik/annotation/Throws;
  2364. value = {
  2365. Ljava/io/EOFException;
  2366. }
  2367. .end annotation
  2368. iget-wide v0, p0, Lokio/Buffer;->size:J
  2369. cmp-long v2, v0, p1
  2370. if-ltz v2, :cond_0
  2371. return-void
  2372. :cond_0
  2373. new-instance p1, Ljava/io/EOFException;
  2374. invoke-direct {p1}, Ljava/io/EOFException;-><init>()V
  2375. throw p1
  2376. .end method
  2377. .method segmentSizes()Ljava/util/List;
  2378. .locals 4
  2379. .annotation system Ldalvik/annotation/Signature;
  2380. value = {
  2381. "()",
  2382. "Ljava/util/List<",
  2383. "Ljava/lang/Integer;",
  2384. ">;"
  2385. }
  2386. .end annotation
  2387. iget-object v0, p0, Lokio/Buffer;->head:Lokio/Segment;
  2388. if-nez v0, :cond_0
  2389. invoke-static {}, Ljava/util/Collections;->emptyList()Ljava/util/List;
  2390. move-result-object v0
  2391. return-object v0
  2392. :cond_0
  2393. new-instance v0, Ljava/util/ArrayList;
  2394. invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V
  2395. iget-object v1, p0, Lokio/Buffer;->head:Lokio/Segment;
  2396. iget v2, v1, Lokio/Segment;->limit:I
  2397. iget v1, v1, Lokio/Segment;->pos:I
  2398. sub-int/2addr v2, v1
  2399. invoke-static {v2}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
  2400. move-result-object v1
  2401. invoke-interface {v0, v1}, Ljava/util/List;->add(Ljava/lang/Object;)Z
  2402. iget-object v1, p0, Lokio/Buffer;->head:Lokio/Segment;
  2403. :goto_0
  2404. iget-object v1, v1, Lokio/Segment;->next:Lokio/Segment;
  2405. iget-object v2, p0, Lokio/Buffer;->head:Lokio/Segment;
  2406. if-eq v1, v2, :cond_1
  2407. iget v2, v1, Lokio/Segment;->limit:I
  2408. iget v3, v1, Lokio/Segment;->pos:I
  2409. sub-int/2addr v2, v3
  2410. invoke-static {v2}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
  2411. move-result-object v2
  2412. invoke-interface {v0, v2}, Ljava/util/List;->add(Ljava/lang/Object;)Z
  2413. goto :goto_0
  2414. :cond_1
  2415. return-object v0
  2416. .end method
  2417. .method public select(Lokio/Options;)I
  2418. .locals 10
  2419. iget-object v6, p0, Lokio/Buffer;->head:Lokio/Segment;
  2420. if-nez v6, :cond_0
  2421. sget-object v0, Lokio/ByteString;->EMPTY:Lokio/ByteString;
  2422. invoke-virtual {p1, v0}, Ljava/util/AbstractList;->indexOf(Ljava/lang/Object;)I
  2423. move-result p1
  2424. return p1
  2425. :cond_0
  2426. iget-object p1, p1, Lokio/Options;->byteStrings:[Lokio/ByteString;
  2427. const/4 v0, 0x0
  2428. array-length v7, p1
  2429. const/4 v8, 0x0
  2430. :goto_0
  2431. if-ge v8, v7, :cond_2
  2432. aget-object v9, p1, v8
  2433. iget-wide v0, p0, Lokio/Buffer;->size:J
  2434. invoke-virtual {v9}, Lokio/ByteString;->size()I
  2435. move-result v2
  2436. int-to-long v2, v2
  2437. cmp-long v4, v0, v2
  2438. if-ltz v4, :cond_1
  2439. iget v2, v6, Lokio/Segment;->pos:I
  2440. const/4 v4, 0x0
  2441. invoke-virtual {v9}, Lokio/ByteString;->size()I
  2442. move-result v5
  2443. move-object v0, p0
  2444. move-object v1, v6
  2445. move-object v3, v9
  2446. invoke-direct/range {v0 .. v5}, Lokio/Buffer;->rangeEquals(Lokio/Segment;ILokio/ByteString;II)Z
  2447. move-result v0
  2448. if-eqz v0, :cond_1
  2449. :try_start_0
  2450. invoke-virtual {v9}, Lokio/ByteString;->size()I
  2451. move-result p1
  2452. int-to-long v0, p1
  2453. invoke-virtual {p0, v0, v1}, Lokio/Buffer;->skip(J)V
  2454. :try_end_0
  2455. .catch Ljava/io/EOFException; {:try_start_0 .. :try_end_0} :catch_0
  2456. return v8
  2457. :catch_0
  2458. move-exception p1
  2459. new-instance v0, Ljava/lang/AssertionError;
  2460. invoke-direct {v0, p1}, Ljava/lang/AssertionError;-><init>(Ljava/lang/Object;)V
  2461. throw v0
  2462. :cond_1
  2463. add-int/lit8 v8, v8, 0x1
  2464. goto :goto_0
  2465. :cond_2
  2466. const/4 p1, -0x1
  2467. return p1
  2468. .end method
  2469. .method selectPrefix(Lokio/Options;)I
  2470. .locals 9
  2471. iget-object v6, p0, Lokio/Buffer;->head:Lokio/Segment;
  2472. iget-object p1, p1, Lokio/Options;->byteStrings:[Lokio/ByteString;
  2473. array-length v7, p1
  2474. const/4 v0, 0x0
  2475. const/4 v8, 0x0
  2476. :goto_0
  2477. if-ge v8, v7, :cond_2
  2478. aget-object v3, p1, v8
  2479. iget-wide v0, p0, Lokio/Buffer;->size:J
  2480. invoke-virtual {v3}, Lokio/ByteString;->size()I
  2481. move-result v2
  2482. int-to-long v4, v2
  2483. invoke-static {v0, v1, v4, v5}, Ljava/lang/Math;->min(JJ)J
  2484. move-result-wide v0
  2485. long-to-int v5, v0
  2486. if-eqz v5, :cond_1
  2487. iget v2, v6, Lokio/Segment;->pos:I
  2488. const/4 v4, 0x0
  2489. move-object v0, p0
  2490. move-object v1, v6
  2491. invoke-direct/range {v0 .. v5}, Lokio/Buffer;->rangeEquals(Lokio/Segment;ILokio/ByteString;II)Z
  2492. move-result v0
  2493. if-eqz v0, :cond_0
  2494. goto :goto_1
  2495. :cond_0
  2496. add-int/lit8 v8, v8, 0x1
  2497. goto :goto_0
  2498. :cond_1
  2499. :goto_1
  2500. return v8
  2501. :cond_2
  2502. const/4 p1, -0x1
  2503. return p1
  2504. .end method
  2505. .method public sha1()Lokio/ByteString;
  2506. .locals 1
  2507. const-string v0, "SHA-1"
  2508. invoke-direct {p0, v0}, Lokio/Buffer;->digest(Ljava/lang/String;)Lokio/ByteString;
  2509. move-result-object v0
  2510. return-object v0
  2511. .end method
  2512. .method public sha256()Lokio/ByteString;
  2513. .locals 1
  2514. const-string v0, "SHA-256"
  2515. invoke-direct {p0, v0}, Lokio/Buffer;->digest(Ljava/lang/String;)Lokio/ByteString;
  2516. move-result-object v0
  2517. return-object v0
  2518. .end method
  2519. .method public sha512()Lokio/ByteString;
  2520. .locals 1
  2521. const-string v0, "SHA-512"
  2522. invoke-direct {p0, v0}, Lokio/Buffer;->digest(Ljava/lang/String;)Lokio/ByteString;
  2523. move-result-object v0
  2524. return-object v0
  2525. .end method
  2526. .method public size()J
  2527. .locals 2
  2528. iget-wide v0, p0, Lokio/Buffer;->size:J
  2529. return-wide v0
  2530. .end method
  2531. .method public skip(J)V
  2532. .locals 6
  2533. .annotation system Ldalvik/annotation/Throws;
  2534. value = {
  2535. Ljava/io/EOFException;
  2536. }
  2537. .end annotation
  2538. :cond_0
  2539. :goto_0
  2540. const-wide/16 v0, 0x0
  2541. cmp-long v2, p1, v0
  2542. if-lez v2, :cond_2
  2543. iget-object v0, p0, Lokio/Buffer;->head:Lokio/Segment;
  2544. if-eqz v0, :cond_1
  2545. iget v1, v0, Lokio/Segment;->limit:I
  2546. iget v0, v0, Lokio/Segment;->pos:I
  2547. sub-int/2addr v1, v0
  2548. int-to-long v0, v1
  2549. invoke-static {p1, p2, v0, v1}, Ljava/lang/Math;->min(JJ)J
  2550. move-result-wide v0
  2551. long-to-int v1, v0
  2552. iget-wide v2, p0, Lokio/Buffer;->size:J
  2553. int-to-long v4, v1
  2554. sub-long/2addr v2, v4
  2555. iput-wide v2, p0, Lokio/Buffer;->size:J
  2556. sub-long/2addr p1, v4
  2557. iget-object v0, p0, Lokio/Buffer;->head:Lokio/Segment;
  2558. iget v2, v0, Lokio/Segment;->pos:I
  2559. add-int/2addr v2, v1
  2560. iput v2, v0, Lokio/Segment;->pos:I
  2561. iget v1, v0, Lokio/Segment;->pos:I
  2562. iget v2, v0, Lokio/Segment;->limit:I
  2563. if-ne v1, v2, :cond_0
  2564. invoke-virtual {v0}, Lokio/Segment;->pop()Lokio/Segment;
  2565. move-result-object v1
  2566. iput-object v1, p0, Lokio/Buffer;->head:Lokio/Segment;
  2567. invoke-static {v0}, Lokio/SegmentPool;->recycle(Lokio/Segment;)V
  2568. goto :goto_0
  2569. :cond_1
  2570. new-instance p1, Ljava/io/EOFException;
  2571. invoke-direct {p1}, Ljava/io/EOFException;-><init>()V
  2572. throw p1
  2573. :cond_2
  2574. return-void
  2575. .end method
  2576. .method public snapshot()Lokio/ByteString;
  2577. .locals 5
  2578. iget-wide v0, p0, Lokio/Buffer;->size:J
  2579. const-wide/32 v2, 0x7fffffff
  2580. cmp-long v4, v0, v2
  2581. if-gtz v4, :cond_0
  2582. long-to-int v1, v0
  2583. invoke-virtual {p0, v1}, Lokio/Buffer;->snapshot(I)Lokio/ByteString;
  2584. move-result-object v0
  2585. return-object v0
  2586. :cond_0
  2587. new-instance v0, Ljava/lang/IllegalArgumentException;
  2588. new-instance v1, Ljava/lang/StringBuilder;
  2589. invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
  2590. const-string v2, "size > Integer.MAX_VALUE: "
  2591. invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
  2592. iget-wide v2, p0, Lokio/Buffer;->size:J
  2593. invoke-virtual {v1, v2, v3}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;
  2594. invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
  2595. move-result-object v1
  2596. invoke-direct {v0, v1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
  2597. throw v0
  2598. .end method
  2599. .method public snapshot(I)Lokio/ByteString;
  2600. .locals 1
  2601. if-nez p1, :cond_0
  2602. sget-object p1, Lokio/ByteString;->EMPTY:Lokio/ByteString;
  2603. return-object p1
  2604. :cond_0
  2605. new-instance v0, Lokio/SegmentedByteString;
  2606. invoke-direct {v0, p0, p1}, Lokio/SegmentedByteString;-><init>(Lokio/Buffer;I)V
  2607. return-object v0
  2608. .end method
  2609. .method public timeout()Lokio/Timeout;
  2610. .locals 1
  2611. sget-object v0, Lokio/Timeout;->NONE:Lokio/Timeout;
  2612. return-object v0
  2613. .end method
  2614. .method public toString()Ljava/lang/String;
  2615. .locals 1
  2616. invoke-virtual {p0}, Lokio/Buffer;->snapshot()Lokio/ByteString;
  2617. move-result-object v0
  2618. invoke-virtual {v0}, Lokio/ByteString;->toString()Ljava/lang/String;
  2619. move-result-object v0
  2620. return-object v0
  2621. .end method
  2622. .method writableSegment(I)Lokio/Segment;
  2623. .locals 3
  2624. const/4 v0, 0x1
  2625. if-lt p1, v0, :cond_3
  2626. const/16 v0, 0x2000
  2627. if-gt p1, v0, :cond_3
  2628. iget-object v1, p0, Lokio/Buffer;->head:Lokio/Segment;
  2629. if-nez v1, :cond_0
  2630. invoke-static {}, Lokio/SegmentPool;->take()Lokio/Segment;
  2631. move-result-object p1
  2632. iput-object p1, p0, Lokio/Buffer;->head:Lokio/Segment;
  2633. iget-object p1, p0, Lokio/Buffer;->head:Lokio/Segment;
  2634. iput-object p1, p1, Lokio/Segment;->prev:Lokio/Segment;
  2635. iput-object p1, p1, Lokio/Segment;->next:Lokio/Segment;
  2636. return-object p1
  2637. :cond_0
  2638. iget-object v1, v1, Lokio/Segment;->prev:Lokio/Segment;
  2639. iget v2, v1, Lokio/Segment;->limit:I
  2640. add-int/2addr v2, p1
  2641. if-gt v2, v0, :cond_1
  2642. iget-boolean p1, v1, Lokio/Segment;->owner:Z
  2643. if-nez p1, :cond_2
  2644. :cond_1
  2645. invoke-static {}, Lokio/SegmentPool;->take()Lokio/Segment;
  2646. move-result-object p1
  2647. invoke-virtual {v1, p1}, Lokio/Segment;->push(Lokio/Segment;)Lokio/Segment;
  2648. move-result-object v1
  2649. :cond_2
  2650. return-object v1
  2651. :cond_3
  2652. new-instance p1, Ljava/lang/IllegalArgumentException;
  2653. invoke-direct {p1}, Ljava/lang/IllegalArgumentException;-><init>()V
  2654. throw p1
  2655. .end method
  2656. .method public write(Lokio/ByteString;)Lokio/Buffer;
  2657. .locals 1
  2658. if-eqz p1, :cond_0
  2659. invoke-virtual {p1, p0}, Lokio/ByteString;->write(Lokio/Buffer;)V
  2660. return-object p0
  2661. :cond_0
  2662. new-instance p1, Ljava/lang/IllegalArgumentException;
  2663. const-string v0, "byteString == null"
  2664. invoke-direct {p1, v0}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
  2665. throw p1
  2666. .end method
  2667. .method public write([B)Lokio/Buffer;
  2668. .locals 2
  2669. if-eqz p1, :cond_0
  2670. const/4 v0, 0x0
  2671. array-length v1, p1
  2672. invoke-virtual {p0, p1, v0, v1}, Lokio/Buffer;->write([BII)Lokio/Buffer;
  2673. move-result-object p1
  2674. return-object p1
  2675. :cond_0
  2676. new-instance p1, Ljava/lang/IllegalArgumentException;
  2677. const-string v0, "source == null"
  2678. invoke-direct {p1, v0}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
  2679. throw p1
  2680. .end method
  2681. .method public write([BII)Lokio/Buffer;
  2682. .locals 9
  2683. if-eqz p1, :cond_1
  2684. array-length v0, p1
  2685. int-to-long v1, v0
  2686. int-to-long v3, p2
  2687. int-to-long v7, p3
  2688. move-wide v5, v7
  2689. invoke-static/range {v1 .. v6}, Lokio/Util;->checkOffsetAndCount(JJJ)V
  2690. add-int/2addr p3, p2
  2691. :goto_0
  2692. if-ge p2, p3, :cond_0
  2693. const/4 v0, 0x1
  2694. invoke-virtual {p0, v0}, Lokio/Buffer;->writableSegment(I)Lokio/Segment;
  2695. move-result-object v0
  2696. sub-int v1, p3, p2
  2697. iget v2, v0, Lokio/Segment;->limit:I
  2698. rsub-int v2, v2, 0x2000
  2699. invoke-static {v1, v2}, Ljava/lang/Math;->min(II)I
  2700. move-result v1
  2701. iget-object v2, v0, Lokio/Segment;->data:[B
  2702. iget v3, v0, Lokio/Segment;->limit:I
  2703. invoke-static {p1, p2, v2, v3, v1}, Ljava/lang/System;->arraycopy(Ljava/lang/Object;ILjava/lang/Object;II)V
  2704. add-int/2addr p2, v1
  2705. iget v2, v0, Lokio/Segment;->limit:I
  2706. add-int/2addr v2, v1
  2707. iput v2, v0, Lokio/Segment;->limit:I
  2708. goto :goto_0
  2709. :cond_0
  2710. iget-wide p1, p0, Lokio/Buffer;->size:J
  2711. add-long/2addr p1, v7
  2712. iput-wide p1, p0, Lokio/Buffer;->size:J
  2713. return-object p0
  2714. :cond_1
  2715. new-instance p1, Ljava/lang/IllegalArgumentException;
  2716. const-string p2, "source == null"
  2717. invoke-direct {p1, p2}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
  2718. goto :goto_2
  2719. :goto_1
  2720. throw p1
  2721. :goto_2
  2722. goto :goto_1
  2723. .end method
  2724. .method public bridge synthetic write(Lokio/ByteString;)Lokio/BufferedSink;
  2725. .locals 0
  2726. .annotation system Ldalvik/annotation/Throws;
  2727. value = {
  2728. Ljava/io/IOException;
  2729. }
  2730. .end annotation
  2731. invoke-virtual {p0, p1}, Lokio/Buffer;->write(Lokio/ByteString;)Lokio/Buffer;
  2732. move-result-object p1
  2733. return-object p1
  2734. .end method
  2735. .method public write(Lokio/Source;J)Lokio/BufferedSink;
  2736. .locals 5
  2737. .annotation system Ldalvik/annotation/Throws;
  2738. value = {
  2739. Ljava/io/IOException;
  2740. }
  2741. .end annotation
  2742. :goto_0
  2743. const-wide/16 v0, 0x0
  2744. cmp-long v2, p2, v0
  2745. if-lez v2, :cond_1
  2746. invoke-interface {p1, p0, p2, p3}, Lokio/Source;->read(Lokio/Buffer;J)J
  2747. move-result-wide v0
  2748. const-wide/16 v2, -0x1
  2749. cmp-long v4, v0, v2
  2750. if-eqz v4, :cond_0
  2751. sub-long/2addr p2, v0
  2752. goto :goto_0
  2753. :cond_0
  2754. new-instance p1, Ljava/io/EOFException;
  2755. invoke-direct {p1}, Ljava/io/EOFException;-><init>()V
  2756. throw p1
  2757. :cond_1
  2758. return-object p0
  2759. .end method
  2760. .method public bridge synthetic write([B)Lokio/BufferedSink;
  2761. .locals 0
  2762. .annotation system Ldalvik/annotation/Throws;
  2763. value = {
  2764. Ljava/io/IOException;
  2765. }
  2766. .end annotation
  2767. invoke-virtual {p0, p1}, Lokio/Buffer;->write([B)Lokio/Buffer;
  2768. move-result-object p1
  2769. return-object p1
  2770. .end method
  2771. .method public bridge synthetic write([BII)Lokio/BufferedSink;
  2772. .locals 0
  2773. .annotation system Ldalvik/annotation/Throws;
  2774. value = {
  2775. Ljava/io/IOException;
  2776. }
  2777. .end annotation
  2778. invoke-virtual {p0, p1, p2, p3}, Lokio/Buffer;->write([BII)Lokio/Buffer;
  2779. move-result-object p1
  2780. return-object p1
  2781. .end method
  2782. .method public write(Lokio/Buffer;J)V
  2783. .locals 6
  2784. if-eqz p1, :cond_7
  2785. if-eq p1, p0, :cond_6
  2786. iget-wide v0, p1, Lokio/Buffer;->size:J
  2787. const-wide/16 v2, 0x0
  2788. move-wide v4, p2
  2789. invoke-static/range {v0 .. v5}, Lokio/Util;->checkOffsetAndCount(JJJ)V
  2790. :goto_0
  2791. const-wide/16 v0, 0x0
  2792. cmp-long v2, p2, v0
  2793. if-lez v2, :cond_5
  2794. iget-object v0, p1, Lokio/Buffer;->head:Lokio/Segment;
  2795. iget v1, v0, Lokio/Segment;->limit:I
  2796. iget v0, v0, Lokio/Segment;->pos:I
  2797. sub-int/2addr v1, v0
  2798. int-to-long v0, v1
  2799. cmp-long v2, p2, v0
  2800. if-gez v2, :cond_3
  2801. iget-object v0, p0, Lokio/Buffer;->head:Lokio/Segment;
  2802. if-eqz v0, :cond_0
  2803. iget-object v0, v0, Lokio/Segment;->prev:Lokio/Segment;
  2804. goto :goto_1
  2805. :cond_0
  2806. const/4 v0, 0x0
  2807. :goto_1
  2808. if-eqz v0, :cond_2
  2809. iget-boolean v1, v0, Lokio/Segment;->owner:Z
  2810. if-eqz v1, :cond_2
  2811. iget v1, v0, Lokio/Segment;->limit:I
  2812. int-to-long v1, v1
  2813. add-long/2addr v1, p2
  2814. iget-boolean v3, v0, Lokio/Segment;->shared:Z
  2815. if-eqz v3, :cond_1
  2816. const/4 v3, 0x0
  2817. goto :goto_2
  2818. :cond_1
  2819. iget v3, v0, Lokio/Segment;->pos:I
  2820. :goto_2
  2821. int-to-long v3, v3
  2822. sub-long/2addr v1, v3
  2823. const-wide/16 v3, 0x2000
  2824. cmp-long v5, v1, v3
  2825. if-gtz v5, :cond_2
  2826. iget-object v1, p1, Lokio/Buffer;->head:Lokio/Segment;
  2827. long-to-int v2, p2
  2828. invoke-virtual {v1, v0, v2}, Lokio/Segment;->writeTo(Lokio/Segment;I)V
  2829. iget-wide v0, p1, Lokio/Buffer;->size:J
  2830. sub-long/2addr v0, p2
  2831. iput-wide v0, p1, Lokio/Buffer;->size:J
  2832. iget-wide v0, p0, Lokio/Buffer;->size:J
  2833. add-long/2addr v0, p2
  2834. iput-wide v0, p0, Lokio/Buffer;->size:J
  2835. return-void
  2836. :cond_2
  2837. iget-object v0, p1, Lokio/Buffer;->head:Lokio/Segment;
  2838. long-to-int v1, p2
  2839. invoke-virtual {v0, v1}, Lokio/Segment;->split(I)Lokio/Segment;
  2840. move-result-object v0
  2841. iput-object v0, p1, Lokio/Buffer;->head:Lokio/Segment;
  2842. :cond_3
  2843. iget-object v0, p1, Lokio/Buffer;->head:Lokio/Segment;
  2844. iget v1, v0, Lokio/Segment;->limit:I
  2845. iget v2, v0, Lokio/Segment;->pos:I
  2846. sub-int/2addr v1, v2
  2847. int-to-long v1, v1
  2848. invoke-virtual {v0}, Lokio/Segment;->pop()Lokio/Segment;
  2849. move-result-object v3
  2850. iput-object v3, p1, Lokio/Buffer;->head:Lokio/Segment;
  2851. iget-object v3, p0, Lokio/Buffer;->head:Lokio/Segment;
  2852. if-nez v3, :cond_4
  2853. iput-object v0, p0, Lokio/Buffer;->head:Lokio/Segment;
  2854. iget-object v0, p0, Lokio/Buffer;->head:Lokio/Segment;
  2855. iput-object v0, v0, Lokio/Segment;->prev:Lokio/Segment;
  2856. iput-object v0, v0, Lokio/Segment;->next:Lokio/Segment;
  2857. goto :goto_3
  2858. :cond_4
  2859. iget-object v3, v3, Lokio/Segment;->prev:Lokio/Segment;
  2860. invoke-virtual {v3, v0}, Lokio/Segment;->push(Lokio/Segment;)Lokio/Segment;
  2861. move-result-object v0
  2862. invoke-virtual {v0}, Lokio/Segment;->compact()V
  2863. :goto_3
  2864. iget-wide v3, p1, Lokio/Buffer;->size:J
  2865. sub-long/2addr v3, v1
  2866. iput-wide v3, p1, Lokio/Buffer;->size:J
  2867. iget-wide v3, p0, Lokio/Buffer;->size:J
  2868. add-long/2addr v3, v1
  2869. iput-wide v3, p0, Lokio/Buffer;->size:J
  2870. sub-long/2addr p2, v1
  2871. goto :goto_0
  2872. :cond_5
  2873. return-void
  2874. :cond_6
  2875. new-instance p1, Ljava/lang/IllegalArgumentException;
  2876. const-string p2, "source == this"
  2877. invoke-direct {p1, p2}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
  2878. throw p1
  2879. :cond_7
  2880. new-instance p1, Ljava/lang/IllegalArgumentException;
  2881. const-string p2, "source == null"
  2882. invoke-direct {p1, p2}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
  2883. goto :goto_5
  2884. :goto_4
  2885. throw p1
  2886. :goto_5
  2887. goto :goto_4
  2888. .end method
  2889. .method public writeAll(Lokio/Source;)J
  2890. .locals 7
  2891. .annotation system Ldalvik/annotation/Throws;
  2892. value = {
  2893. Ljava/io/IOException;
  2894. }
  2895. .end annotation
  2896. if-eqz p1, :cond_1
  2897. const-wide/16 v0, 0x0
  2898. :goto_0
  2899. const-wide/16 v2, 0x2000
  2900. invoke-interface {p1, p0, v2, v3}, Lokio/Source;->read(Lokio/Buffer;J)J
  2901. move-result-wide v2
  2902. const-wide/16 v4, -0x1
  2903. cmp-long v6, v2, v4
  2904. if-eqz v6, :cond_0
  2905. add-long/2addr v0, v2
  2906. goto :goto_0
  2907. :cond_0
  2908. return-wide v0
  2909. :cond_1
  2910. new-instance p1, Ljava/lang/IllegalArgumentException;
  2911. const-string v0, "source == null"
  2912. invoke-direct {p1, v0}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
  2913. goto :goto_2
  2914. :goto_1
  2915. throw p1
  2916. :goto_2
  2917. goto :goto_1
  2918. .end method
  2919. .method public writeByte(I)Lokio/Buffer;
  2920. .locals 4
  2921. const/4 v0, 0x1
  2922. invoke-virtual {p0, v0}, Lokio/Buffer;->writableSegment(I)Lokio/Segment;
  2923. move-result-object v0
  2924. iget-object v1, v0, Lokio/Segment;->data:[B
  2925. iget v2, v0, Lokio/Segment;->limit:I
  2926. add-int/lit8 v3, v2, 0x1
  2927. iput v3, v0, Lokio/Segment;->limit:I
  2928. int-to-byte p1, p1
  2929. aput-byte p1, v1, v2
  2930. iget-wide v0, p0, Lokio/Buffer;->size:J
  2931. const-wide/16 v2, 0x1
  2932. add-long/2addr v0, v2
  2933. iput-wide v0, p0, Lokio/Buffer;->size:J
  2934. return-object p0
  2935. .end method
  2936. .method public bridge synthetic writeByte(I)Lokio/BufferedSink;
  2937. .locals 0
  2938. .annotation system Ldalvik/annotation/Throws;
  2939. value = {
  2940. Ljava/io/IOException;
  2941. }
  2942. .end annotation
  2943. invoke-virtual {p0, p1}, Lokio/Buffer;->writeByte(I)Lokio/Buffer;
  2944. move-result-object p1
  2945. return-object p1
  2946. .end method
  2947. .method public writeDecimalLong(J)Lokio/Buffer;
  2948. .locals 11
  2949. const-wide/16 v0, 0x0
  2950. cmp-long v2, p1, v0
  2951. if-nez v2, :cond_0
  2952. const/16 p1, 0x30
  2953. invoke-virtual {p0, p1}, Lokio/Buffer;->writeByte(I)Lokio/Buffer;
  2954. move-result-object p1
  2955. return-object p1
  2956. :cond_0
  2957. const/4 v2, 0x0
  2958. const/4 v3, 0x1
  2959. cmp-long v4, p1, v0
  2960. if-gez v4, :cond_2
  2961. neg-long p1, p1
  2962. cmp-long v2, p1, v0
  2963. if-gez v2, :cond_1
  2964. const-string p1, "-9223372036854775808"
  2965. invoke-virtual {p0, p1}, Lokio/Buffer;->writeUtf8(Ljava/lang/String;)Lokio/Buffer;
  2966. move-result-object p1
  2967. return-object p1
  2968. :cond_1
  2969. const/4 v2, 0x1
  2970. :cond_2
  2971. const-wide/32 v4, 0x5f5e100
  2972. const-wide/16 v6, 0xa
  2973. cmp-long v8, p1, v4
  2974. if-gez v8, :cond_a
  2975. const-wide/16 v4, 0x2710
  2976. cmp-long v8, p1, v4
  2977. if-gez v8, :cond_6
  2978. const-wide/16 v4, 0x64
  2979. cmp-long v8, p1, v4
  2980. if-gez v8, :cond_4
  2981. cmp-long v4, p1, v6
  2982. if-gez v4, :cond_3
  2983. goto/16 :goto_0
  2984. :cond_3
  2985. const/4 v3, 0x2
  2986. goto/16 :goto_0
  2987. :cond_4
  2988. const-wide/16 v3, 0x3e8
  2989. cmp-long v5, p1, v3
  2990. if-gez v5, :cond_5
  2991. const/4 v3, 0x3
  2992. goto/16 :goto_0
  2993. :cond_5
  2994. const/4 v3, 0x4
  2995. goto/16 :goto_0
  2996. :cond_6
  2997. const-wide/32 v3, 0xf4240
  2998. cmp-long v5, p1, v3
  2999. if-gez v5, :cond_8
  3000. const-wide/32 v3, 0x186a0
  3001. cmp-long v5, p1, v3
  3002. if-gez v5, :cond_7
  3003. const/4 v3, 0x5
  3004. goto/16 :goto_0
  3005. :cond_7
  3006. const/4 v3, 0x6
  3007. goto/16 :goto_0
  3008. :cond_8
  3009. const-wide/32 v3, 0x989680
  3010. cmp-long v5, p1, v3
  3011. if-gez v5, :cond_9
  3012. const/4 v3, 0x7
  3013. goto/16 :goto_0
  3014. :cond_9
  3015. const/16 v3, 0x8
  3016. goto/16 :goto_0
  3017. :cond_a
  3018. const-wide v3, 0xe8d4a51000L
  3019. cmp-long v5, p1, v3
  3020. if-gez v5, :cond_e
  3021. const-wide v3, 0x2540be400L
  3022. cmp-long v5, p1, v3
  3023. if-gez v5, :cond_c
  3024. const-wide/32 v3, 0x3b9aca00
  3025. cmp-long v5, p1, v3
  3026. if-gez v5, :cond_b
  3027. const/16 v3, 0x9
  3028. goto :goto_0
  3029. :cond_b
  3030. const/16 v3, 0xa
  3031. goto :goto_0
  3032. :cond_c
  3033. const-wide v3, 0x174876e800L
  3034. cmp-long v5, p1, v3
  3035. if-gez v5, :cond_d
  3036. const/16 v3, 0xb
  3037. goto :goto_0
  3038. :cond_d
  3039. const/16 v3, 0xc
  3040. goto :goto_0
  3041. :cond_e
  3042. const-wide v3, 0x38d7ea4c68000L
  3043. cmp-long v5, p1, v3
  3044. if-gez v5, :cond_11
  3045. const-wide v3, 0x9184e72a000L
  3046. cmp-long v5, p1, v3
  3047. if-gez v5, :cond_f
  3048. const/16 v3, 0xd
  3049. goto :goto_0
  3050. :cond_f
  3051. const-wide v3, 0x5af3107a4000L
  3052. cmp-long v5, p1, v3
  3053. if-gez v5, :cond_10
  3054. const/16 v3, 0xe
  3055. goto :goto_0
  3056. :cond_10
  3057. const/16 v3, 0xf
  3058. goto :goto_0
  3059. :cond_11
  3060. const-wide v3, 0x16345785d8a0000L
  3061. cmp-long v5, p1, v3
  3062. if-gez v5, :cond_13
  3063. const-wide v3, 0x2386f26fc10000L
  3064. cmp-long v5, p1, v3
  3065. if-gez v5, :cond_12
  3066. const/16 v3, 0x10
  3067. goto :goto_0
  3068. :cond_12
  3069. const/16 v3, 0x11
  3070. goto :goto_0
  3071. :cond_13
  3072. const-wide v3, 0xde0b6b3a7640000L
  3073. cmp-long v5, p1, v3
  3074. if-gez v5, :cond_14
  3075. const/16 v3, 0x12
  3076. goto :goto_0
  3077. :cond_14
  3078. const/16 v3, 0x13
  3079. :goto_0
  3080. if-eqz v2, :cond_15
  3081. add-int/lit8 v3, v3, 0x1
  3082. :cond_15
  3083. invoke-virtual {p0, v3}, Lokio/Buffer;->writableSegment(I)Lokio/Segment;
  3084. move-result-object v4
  3085. iget-object v5, v4, Lokio/Segment;->data:[B
  3086. iget v8, v4, Lokio/Segment;->limit:I
  3087. add-int/2addr v8, v3
  3088. :goto_1
  3089. cmp-long v9, p1, v0
  3090. if-eqz v9, :cond_16
  3091. rem-long v9, p1, v6
  3092. long-to-int v10, v9
  3093. add-int/lit8 v8, v8, -0x1
  3094. sget-object v9, Lokio/Buffer;->DIGITS:[B
  3095. aget-byte v9, v9, v10
  3096. aput-byte v9, v5, v8
  3097. div-long/2addr p1, v6
  3098. goto :goto_1
  3099. :cond_16
  3100. if-eqz v2, :cond_17
  3101. add-int/lit8 v8, v8, -0x1
  3102. const/16 p1, 0x2d
  3103. aput-byte p1, v5, v8
  3104. :cond_17
  3105. iget p1, v4, Lokio/Segment;->limit:I
  3106. add-int/2addr p1, v3
  3107. iput p1, v4, Lokio/Segment;->limit:I
  3108. iget-wide p1, p0, Lokio/Buffer;->size:J
  3109. int-to-long v0, v3
  3110. add-long/2addr p1, v0
  3111. iput-wide p1, p0, Lokio/Buffer;->size:J
  3112. return-object p0
  3113. .end method
  3114. .method public bridge synthetic writeDecimalLong(J)Lokio/BufferedSink;
  3115. .locals 0
  3116. .annotation system Ldalvik/annotation/Throws;
  3117. value = {
  3118. Ljava/io/IOException;
  3119. }
  3120. .end annotation
  3121. invoke-virtual {p0, p1, p2}, Lokio/Buffer;->writeDecimalLong(J)Lokio/Buffer;
  3122. move-result-object p1
  3123. return-object p1
  3124. .end method
  3125. .method public writeHexadecimalUnsignedLong(J)Lokio/Buffer;
  3126. .locals 9
  3127. const-wide/16 v0, 0x0
  3128. cmp-long v2, p1, v0
  3129. if-nez v2, :cond_0
  3130. const/16 p1, 0x30
  3131. invoke-virtual {p0, p1}, Lokio/Buffer;->writeByte(I)Lokio/Buffer;
  3132. move-result-object p1
  3133. return-object p1
  3134. :cond_0
  3135. invoke-static {p1, p2}, Ljava/lang/Long;->highestOneBit(J)J
  3136. move-result-wide v0
  3137. invoke-static {v0, v1}, Ljava/lang/Long;->numberOfTrailingZeros(J)I
  3138. move-result v0
  3139. const/4 v1, 0x4
  3140. div-int/2addr v0, v1
  3141. add-int/lit8 v0, v0, 0x1
  3142. invoke-virtual {p0, v0}, Lokio/Buffer;->writableSegment(I)Lokio/Segment;
  3143. move-result-object v2
  3144. iget-object v3, v2, Lokio/Segment;->data:[B
  3145. iget v4, v2, Lokio/Segment;->limit:I
  3146. add-int v5, v4, v0
  3147. add-int/lit8 v5, v5, -0x1
  3148. :goto_0
  3149. if-lt v5, v4, :cond_1
  3150. sget-object v6, Lokio/Buffer;->DIGITS:[B
  3151. const-wide/16 v7, 0xf
  3152. and-long/2addr v7, p1
  3153. long-to-int v8, v7
  3154. aget-byte v6, v6, v8
  3155. aput-byte v6, v3, v5
  3156. ushr-long/2addr p1, v1
  3157. add-int/lit8 v5, v5, -0x1
  3158. goto :goto_0
  3159. :cond_1
  3160. iget p1, v2, Lokio/Segment;->limit:I
  3161. add-int/2addr p1, v0
  3162. iput p1, v2, Lokio/Segment;->limit:I
  3163. iget-wide p1, p0, Lokio/Buffer;->size:J
  3164. int-to-long v0, v0
  3165. add-long/2addr p1, v0
  3166. iput-wide p1, p0, Lokio/Buffer;->size:J
  3167. return-object p0
  3168. .end method
  3169. .method public bridge synthetic writeHexadecimalUnsignedLong(J)Lokio/BufferedSink;
  3170. .locals 0
  3171. .annotation system Ldalvik/annotation/Throws;
  3172. value = {
  3173. Ljava/io/IOException;
  3174. }
  3175. .end annotation
  3176. invoke-virtual {p0, p1, p2}, Lokio/Buffer;->writeHexadecimalUnsignedLong(J)Lokio/Buffer;
  3177. move-result-object p1
  3178. return-object p1
  3179. .end method
  3180. .method public writeInt(I)Lokio/Buffer;
  3181. .locals 5
  3182. const/4 v0, 0x4
  3183. invoke-virtual {p0, v0}, Lokio/Buffer;->writableSegment(I)Lokio/Segment;
  3184. move-result-object v0
  3185. iget-object v1, v0, Lokio/Segment;->data:[B
  3186. iget v2, v0, Lokio/Segment;->limit:I
  3187. add-int/lit8 v3, v2, 0x1
  3188. ushr-int/lit8 v4, p1, 0x18
  3189. and-int/lit16 v4, v4, 0xff
  3190. int-to-byte v4, v4
  3191. aput-byte v4, v1, v2
  3192. add-int/lit8 v2, v3, 0x1
  3193. ushr-int/lit8 v4, p1, 0x10
  3194. and-int/lit16 v4, v4, 0xff
  3195. int-to-byte v4, v4
  3196. aput-byte v4, v1, v3
  3197. add-int/lit8 v3, v2, 0x1
  3198. ushr-int/lit8 v4, p1, 0x8
  3199. and-int/lit16 v4, v4, 0xff
  3200. int-to-byte v4, v4
  3201. aput-byte v4, v1, v2
  3202. add-int/lit8 v2, v3, 0x1
  3203. and-int/lit16 p1, p1, 0xff
  3204. int-to-byte p1, p1
  3205. aput-byte p1, v1, v3
  3206. iput v2, v0, Lokio/Segment;->limit:I
  3207. iget-wide v0, p0, Lokio/Buffer;->size:J
  3208. const-wide/16 v2, 0x4
  3209. add-long/2addr v0, v2
  3210. iput-wide v0, p0, Lokio/Buffer;->size:J
  3211. return-object p0
  3212. .end method
  3213. .method public bridge synthetic writeInt(I)Lokio/BufferedSink;
  3214. .locals 0
  3215. .annotation system Ldalvik/annotation/Throws;
  3216. value = {
  3217. Ljava/io/IOException;
  3218. }
  3219. .end annotation
  3220. invoke-virtual {p0, p1}, Lokio/Buffer;->writeInt(I)Lokio/Buffer;
  3221. move-result-object p1
  3222. return-object p1
  3223. .end method
  3224. .method public writeIntLe(I)Lokio/Buffer;
  3225. .locals 0
  3226. invoke-static {p1}, Lokio/Util;->reverseBytesInt(I)I
  3227. move-result p1
  3228. invoke-virtual {p0, p1}, Lokio/Buffer;->writeInt(I)Lokio/Buffer;
  3229. move-result-object p1
  3230. return-object p1
  3231. .end method
  3232. .method public bridge synthetic writeIntLe(I)Lokio/BufferedSink;
  3233. .locals 0
  3234. .annotation system Ldalvik/annotation/Throws;
  3235. value = {
  3236. Ljava/io/IOException;
  3237. }
  3238. .end annotation
  3239. invoke-virtual {p0, p1}, Lokio/Buffer;->writeIntLe(I)Lokio/Buffer;
  3240. move-result-object p1
  3241. return-object p1
  3242. .end method
  3243. .method public writeLong(J)Lokio/Buffer;
  3244. .locals 9
  3245. const/16 v0, 0x8
  3246. invoke-virtual {p0, v0}, Lokio/Buffer;->writableSegment(I)Lokio/Segment;
  3247. move-result-object v1
  3248. iget-object v2, v1, Lokio/Segment;->data:[B
  3249. iget v3, v1, Lokio/Segment;->limit:I
  3250. add-int/lit8 v4, v3, 0x1
  3251. const/16 v5, 0x38
  3252. ushr-long v5, p1, v5
  3253. const-wide/16 v7, 0xff
  3254. and-long/2addr v5, v7
  3255. long-to-int v6, v5
  3256. int-to-byte v5, v6
  3257. aput-byte v5, v2, v3
  3258. add-int/lit8 v3, v4, 0x1
  3259. const/16 v5, 0x30
  3260. ushr-long v5, p1, v5
  3261. and-long/2addr v5, v7
  3262. long-to-int v6, v5
  3263. int-to-byte v5, v6
  3264. aput-byte v5, v2, v4
  3265. add-int/lit8 v4, v3, 0x1
  3266. const/16 v5, 0x28
  3267. ushr-long v5, p1, v5
  3268. and-long/2addr v5, v7
  3269. long-to-int v6, v5
  3270. int-to-byte v5, v6
  3271. aput-byte v5, v2, v3
  3272. add-int/lit8 v3, v4, 0x1
  3273. const/16 v5, 0x20
  3274. ushr-long v5, p1, v5
  3275. and-long/2addr v5, v7
  3276. long-to-int v6, v5
  3277. int-to-byte v5, v6
  3278. aput-byte v5, v2, v4
  3279. add-int/lit8 v4, v3, 0x1
  3280. const/16 v5, 0x18
  3281. ushr-long v5, p1, v5
  3282. and-long/2addr v5, v7
  3283. long-to-int v6, v5
  3284. int-to-byte v5, v6
  3285. aput-byte v5, v2, v3
  3286. add-int/lit8 v3, v4, 0x1
  3287. const/16 v5, 0x10
  3288. ushr-long v5, p1, v5
  3289. and-long/2addr v5, v7
  3290. long-to-int v6, v5
  3291. int-to-byte v5, v6
  3292. aput-byte v5, v2, v4
  3293. add-int/lit8 v4, v3, 0x1
  3294. ushr-long v5, p1, v0
  3295. and-long/2addr v5, v7
  3296. long-to-int v0, v5
  3297. int-to-byte v0, v0
  3298. aput-byte v0, v2, v3
  3299. add-int/lit8 v0, v4, 0x1
  3300. and-long/2addr p1, v7
  3301. long-to-int p2, p1
  3302. int-to-byte p1, p2
  3303. aput-byte p1, v2, v4
  3304. iput v0, v1, Lokio/Segment;->limit:I
  3305. iget-wide p1, p0, Lokio/Buffer;->size:J
  3306. const-wide/16 v0, 0x8
  3307. add-long/2addr p1, v0
  3308. iput-wide p1, p0, Lokio/Buffer;->size:J
  3309. return-object p0
  3310. .end method
  3311. .method public bridge synthetic writeLong(J)Lokio/BufferedSink;
  3312. .locals 0
  3313. .annotation system Ldalvik/annotation/Throws;
  3314. value = {
  3315. Ljava/io/IOException;
  3316. }
  3317. .end annotation
  3318. invoke-virtual {p0, p1, p2}, Lokio/Buffer;->writeLong(J)Lokio/Buffer;
  3319. move-result-object p1
  3320. return-object p1
  3321. .end method
  3322. .method public writeLongLe(J)Lokio/Buffer;
  3323. .locals 0
  3324. invoke-static {p1, p2}, Lokio/Util;->reverseBytesLong(J)J
  3325. move-result-wide p1
  3326. invoke-virtual {p0, p1, p2}, Lokio/Buffer;->writeLong(J)Lokio/Buffer;
  3327. move-result-object p1
  3328. return-object p1
  3329. .end method
  3330. .method public bridge synthetic writeLongLe(J)Lokio/BufferedSink;
  3331. .locals 0
  3332. .annotation system Ldalvik/annotation/Throws;
  3333. value = {
  3334. Ljava/io/IOException;
  3335. }
  3336. .end annotation
  3337. invoke-virtual {p0, p1, p2}, Lokio/Buffer;->writeLongLe(J)Lokio/Buffer;
  3338. move-result-object p1
  3339. return-object p1
  3340. .end method
  3341. .method public writeShort(I)Lokio/Buffer;
  3342. .locals 5
  3343. const/4 v0, 0x2
  3344. invoke-virtual {p0, v0}, Lokio/Buffer;->writableSegment(I)Lokio/Segment;
  3345. move-result-object v0
  3346. iget-object v1, v0, Lokio/Segment;->data:[B
  3347. iget v2, v0, Lokio/Segment;->limit:I
  3348. add-int/lit8 v3, v2, 0x1
  3349. ushr-int/lit8 v4, p1, 0x8
  3350. and-int/lit16 v4, v4, 0xff
  3351. int-to-byte v4, v4
  3352. aput-byte v4, v1, v2
  3353. add-int/lit8 v2, v3, 0x1
  3354. and-int/lit16 p1, p1, 0xff
  3355. int-to-byte p1, p1
  3356. aput-byte p1, v1, v3
  3357. iput v2, v0, Lokio/Segment;->limit:I
  3358. iget-wide v0, p0, Lokio/Buffer;->size:J
  3359. const-wide/16 v2, 0x2
  3360. add-long/2addr v0, v2
  3361. iput-wide v0, p0, Lokio/Buffer;->size:J
  3362. return-object p0
  3363. .end method
  3364. .method public bridge synthetic writeShort(I)Lokio/BufferedSink;
  3365. .locals 0
  3366. .annotation system Ldalvik/annotation/Throws;
  3367. value = {
  3368. Ljava/io/IOException;
  3369. }
  3370. .end annotation
  3371. invoke-virtual {p0, p1}, Lokio/Buffer;->writeShort(I)Lokio/Buffer;
  3372. move-result-object p1
  3373. return-object p1
  3374. .end method
  3375. .method public writeShortLe(I)Lokio/Buffer;
  3376. .locals 0
  3377. int-to-short p1, p1
  3378. invoke-static {p1}, Lokio/Util;->reverseBytesShort(S)S
  3379. move-result p1
  3380. invoke-virtual {p0, p1}, Lokio/Buffer;->writeShort(I)Lokio/Buffer;
  3381. move-result-object p1
  3382. return-object p1
  3383. .end method
  3384. .method public bridge synthetic writeShortLe(I)Lokio/BufferedSink;
  3385. .locals 0
  3386. .annotation system Ldalvik/annotation/Throws;
  3387. value = {
  3388. Ljava/io/IOException;
  3389. }
  3390. .end annotation
  3391. invoke-virtual {p0, p1}, Lokio/Buffer;->writeShortLe(I)Lokio/Buffer;
  3392. move-result-object p1
  3393. return-object p1
  3394. .end method
  3395. .method public writeString(Ljava/lang/String;IILjava/nio/charset/Charset;)Lokio/Buffer;
  3396. .locals 1
  3397. if-eqz p1, :cond_5
  3398. if-ltz p2, :cond_4
  3399. if-lt p3, p2, :cond_3
  3400. invoke-virtual {p1}, Ljava/lang/String;->length()I
  3401. move-result v0
  3402. if-gt p3, v0, :cond_2
  3403. if-eqz p4, :cond_1
  3404. sget-object v0, Lokio/Util;->UTF_8:Ljava/nio/charset/Charset;
  3405. invoke-virtual {p4, v0}, Ljava/nio/charset/Charset;->equals(Ljava/lang/Object;)Z
  3406. move-result v0
  3407. if-eqz v0, :cond_0
  3408. invoke-virtual {p0, p1, p2, p3}, Lokio/Buffer;->writeUtf8(Ljava/lang/String;II)Lokio/Buffer;
  3409. move-result-object p1
  3410. return-object p1
  3411. :cond_0
  3412. invoke-virtual {p1, p2, p3}, Ljava/lang/String;->substring(II)Ljava/lang/String;
  3413. move-result-object p1
  3414. invoke-virtual {p1, p4}, Ljava/lang/String;->getBytes(Ljava/nio/charset/Charset;)[B
  3415. move-result-object p1
  3416. const/4 p2, 0x0
  3417. array-length p3, p1
  3418. invoke-virtual {p0, p1, p2, p3}, Lokio/Buffer;->write([BII)Lokio/Buffer;
  3419. move-result-object p1
  3420. return-object p1
  3421. :cond_1
  3422. new-instance p1, Ljava/lang/IllegalArgumentException;
  3423. const-string p2, "charset == null"
  3424. invoke-direct {p1, p2}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
  3425. throw p1
  3426. :cond_2
  3427. new-instance p2, Ljava/lang/IllegalArgumentException;
  3428. new-instance p4, Ljava/lang/StringBuilder;
  3429. invoke-direct {p4}, Ljava/lang/StringBuilder;-><init>()V
  3430. const-string v0, "endIndex > string.length: "
  3431. invoke-virtual {p4, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
  3432. invoke-virtual {p4, p3}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
  3433. const-string p3, " > "
  3434. invoke-virtual {p4, p3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
  3435. invoke-virtual {p1}, Ljava/lang/String;->length()I
  3436. move-result p1
  3437. invoke-virtual {p4, p1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
  3438. invoke-virtual {p4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
  3439. move-result-object p1
  3440. invoke-direct {p2, p1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
  3441. throw p2
  3442. :cond_3
  3443. new-instance p1, Ljava/lang/IllegalArgumentException;
  3444. new-instance p4, Ljava/lang/StringBuilder;
  3445. invoke-direct {p4}, Ljava/lang/StringBuilder;-><init>()V
  3446. const-string v0, "endIndex < beginIndex: "
  3447. invoke-virtual {p4, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
  3448. invoke-virtual {p4, p3}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
  3449. const-string p3, " < "
  3450. invoke-virtual {p4, p3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
  3451. invoke-virtual {p4, p2}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
  3452. invoke-virtual {p4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
  3453. move-result-object p2
  3454. invoke-direct {p1, p2}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
  3455. throw p1
  3456. :cond_4
  3457. new-instance p1, Ljava/lang/IllegalAccessError;
  3458. new-instance p3, Ljava/lang/StringBuilder;
  3459. invoke-direct {p3}, Ljava/lang/StringBuilder;-><init>()V
  3460. const-string p4, "beginIndex < 0: "
  3461. invoke-virtual {p3, p4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
  3462. invoke-virtual {p3, p2}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
  3463. invoke-virtual {p3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
  3464. move-result-object p2
  3465. invoke-direct {p1, p2}, Ljava/lang/IllegalAccessError;-><init>(Ljava/lang/String;)V
  3466. throw p1
  3467. :cond_5
  3468. new-instance p1, Ljava/lang/IllegalArgumentException;
  3469. const-string p2, "string == null"
  3470. invoke-direct {p1, p2}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
  3471. throw p1
  3472. .end method
  3473. .method public writeString(Ljava/lang/String;Ljava/nio/charset/Charset;)Lokio/Buffer;
  3474. .locals 2
  3475. invoke-virtual {p1}, Ljava/lang/String;->length()I
  3476. move-result v0
  3477. const/4 v1, 0x0
  3478. invoke-virtual {p0, p1, v1, v0, p2}, Lokio/Buffer;->writeString(Ljava/lang/String;IILjava/nio/charset/Charset;)Lokio/Buffer;
  3479. move-result-object p1
  3480. return-object p1
  3481. .end method
  3482. .method public bridge synthetic writeString(Ljava/lang/String;IILjava/nio/charset/Charset;)Lokio/BufferedSink;
  3483. .locals 0
  3484. .annotation system Ldalvik/annotation/Throws;
  3485. value = {
  3486. Ljava/io/IOException;
  3487. }
  3488. .end annotation
  3489. invoke-virtual {p0, p1, p2, p3, p4}, Lokio/Buffer;->writeString(Ljava/lang/String;IILjava/nio/charset/Charset;)Lokio/Buffer;
  3490. move-result-object p1
  3491. return-object p1
  3492. .end method
  3493. .method public bridge synthetic writeString(Ljava/lang/String;Ljava/nio/charset/Charset;)Lokio/BufferedSink;
  3494. .locals 0
  3495. .annotation system Ldalvik/annotation/Throws;
  3496. value = {
  3497. Ljava/io/IOException;
  3498. }
  3499. .end annotation
  3500. invoke-virtual {p0, p1, p2}, Lokio/Buffer;->writeString(Ljava/lang/String;Ljava/nio/charset/Charset;)Lokio/Buffer;
  3501. move-result-object p1
  3502. return-object p1
  3503. .end method
  3504. .method public writeTo(Ljava/io/OutputStream;)Lokio/Buffer;
  3505. .locals 2
  3506. .annotation system Ldalvik/annotation/Throws;
  3507. value = {
  3508. Ljava/io/IOException;
  3509. }
  3510. .end annotation
  3511. iget-wide v0, p0, Lokio/Buffer;->size:J
  3512. invoke-virtual {p0, p1, v0, v1}, Lokio/Buffer;->writeTo(Ljava/io/OutputStream;J)Lokio/Buffer;
  3513. move-result-object p1
  3514. return-object p1
  3515. .end method
  3516. .method public writeTo(Ljava/io/OutputStream;J)Lokio/Buffer;
  3517. .locals 6
  3518. .annotation system Ldalvik/annotation/Throws;
  3519. value = {
  3520. Ljava/io/IOException;
  3521. }
  3522. .end annotation
  3523. if-eqz p1, :cond_2
  3524. iget-wide v0, p0, Lokio/Buffer;->size:J
  3525. const-wide/16 v2, 0x0
  3526. move-wide v4, p2
  3527. invoke-static/range {v0 .. v5}, Lokio/Util;->checkOffsetAndCount(JJJ)V
  3528. iget-object v0, p0, Lokio/Buffer;->head:Lokio/Segment;
  3529. :cond_0
  3530. :goto_0
  3531. const-wide/16 v1, 0x0
  3532. cmp-long v3, p2, v1
  3533. if-lez v3, :cond_1
  3534. iget v1, v0, Lokio/Segment;->limit:I
  3535. iget v2, v0, Lokio/Segment;->pos:I
  3536. sub-int/2addr v1, v2
  3537. int-to-long v1, v1
  3538. invoke-static {p2, p3, v1, v2}, Ljava/lang/Math;->min(JJ)J
  3539. move-result-wide v1
  3540. long-to-int v2, v1
  3541. iget-object v1, v0, Lokio/Segment;->data:[B
  3542. iget v3, v0, Lokio/Segment;->pos:I
  3543. invoke-virtual {p1, v1, v3, v2}, Ljava/io/OutputStream;->write([BII)V
  3544. iget v1, v0, Lokio/Segment;->pos:I
  3545. add-int/2addr v1, v2
  3546. iput v1, v0, Lokio/Segment;->pos:I
  3547. iget-wide v3, p0, Lokio/Buffer;->size:J
  3548. int-to-long v1, v2
  3549. sub-long/2addr v3, v1
  3550. iput-wide v3, p0, Lokio/Buffer;->size:J
  3551. sub-long/2addr p2, v1
  3552. iget v1, v0, Lokio/Segment;->pos:I
  3553. iget v2, v0, Lokio/Segment;->limit:I
  3554. if-ne v1, v2, :cond_0
  3555. invoke-virtual {v0}, Lokio/Segment;->pop()Lokio/Segment;
  3556. move-result-object v1
  3557. iput-object v1, p0, Lokio/Buffer;->head:Lokio/Segment;
  3558. invoke-static {v0}, Lokio/SegmentPool;->recycle(Lokio/Segment;)V
  3559. move-object v0, v1
  3560. goto :goto_0
  3561. :cond_1
  3562. return-object p0
  3563. :cond_2
  3564. new-instance p1, Ljava/lang/IllegalArgumentException;
  3565. const-string p2, "out == null"
  3566. invoke-direct {p1, p2}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
  3567. goto :goto_2
  3568. :goto_1
  3569. throw p1
  3570. :goto_2
  3571. goto :goto_1
  3572. .end method
  3573. .method public writeUtf8(Ljava/lang/String;)Lokio/Buffer;
  3574. .locals 2
  3575. invoke-virtual {p1}, Ljava/lang/String;->length()I
  3576. move-result v0
  3577. const/4 v1, 0x0
  3578. invoke-virtual {p0, p1, v1, v0}, Lokio/Buffer;->writeUtf8(Ljava/lang/String;II)Lokio/Buffer;
  3579. move-result-object p1
  3580. return-object p1
  3581. .end method
  3582. .method public writeUtf8(Ljava/lang/String;II)Lokio/Buffer;
  3583. .locals 7
  3584. if-eqz p1, :cond_d
  3585. if-ltz p2, :cond_c
  3586. if-lt p3, p2, :cond_b
  3587. invoke-virtual {p1}, Ljava/lang/String;->length()I
  3588. move-result v0
  3589. if-gt p3, v0, :cond_a
  3590. :goto_0
  3591. if-ge p2, p3, :cond_9
  3592. invoke-virtual {p1, p2}, Ljava/lang/String;->charAt(I)C
  3593. move-result v0
  3594. const/16 v1, 0x80
  3595. if-ge v0, v1, :cond_2
  3596. const/4 v2, 0x1
  3597. invoke-virtual {p0, v2}, Lokio/Buffer;->writableSegment(I)Lokio/Segment;
  3598. move-result-object v2
  3599. iget-object v3, v2, Lokio/Segment;->data:[B
  3600. iget v4, v2, Lokio/Segment;->limit:I
  3601. sub-int/2addr v4, p2
  3602. rsub-int v5, v4, 0x2000
  3603. invoke-static {p3, v5}, Ljava/lang/Math;->min(II)I
  3604. move-result v5
  3605. add-int/lit8 v6, p2, 0x1
  3606. add-int/2addr p2, v4
  3607. int-to-byte v0, v0
  3608. aput-byte v0, v3, p2
  3609. :goto_1
  3610. if-ge v6, v5, :cond_1
  3611. invoke-virtual {p1, v6}, Ljava/lang/String;->charAt(I)C
  3612. move-result p2
  3613. if-lt p2, v1, :cond_0
  3614. goto :goto_2
  3615. :cond_0
  3616. add-int/lit8 v0, v6, 0x1
  3617. add-int/2addr v6, v4
  3618. int-to-byte p2, p2
  3619. aput-byte p2, v3, v6
  3620. move v6, v0
  3621. goto :goto_1
  3622. :cond_1
  3623. :goto_2
  3624. add-int/2addr v4, v6
  3625. iget p2, v2, Lokio/Segment;->limit:I
  3626. sub-int/2addr v4, p2
  3627. add-int/2addr p2, v4
  3628. iput p2, v2, Lokio/Segment;->limit:I
  3629. iget-wide v0, p0, Lokio/Buffer;->size:J
  3630. int-to-long v2, v4
  3631. add-long/2addr v0, v2
  3632. iput-wide v0, p0, Lokio/Buffer;->size:J
  3633. move p2, v6
  3634. goto :goto_0
  3635. :cond_2
  3636. const/16 v2, 0x800
  3637. if-ge v0, v2, :cond_3
  3638. shr-int/lit8 v2, v0, 0x6
  3639. or-int/lit16 v2, v2, 0xc0
  3640. :goto_3
  3641. invoke-virtual {p0, v2}, Lokio/Buffer;->writeByte(I)Lokio/Buffer;
  3642. and-int/lit8 v0, v0, 0x3f
  3643. or-int/2addr v0, v1
  3644. invoke-virtual {p0, v0}, Lokio/Buffer;->writeByte(I)Lokio/Buffer;
  3645. add-int/lit8 p2, p2, 0x1
  3646. goto :goto_0
  3647. :cond_3
  3648. const v2, 0xd800
  3649. const/16 v3, 0x3f
  3650. if-lt v0, v2, :cond_8
  3651. const v2, 0xdfff
  3652. if-le v0, v2, :cond_4
  3653. goto :goto_6
  3654. :cond_4
  3655. add-int/lit8 v4, p2, 0x1
  3656. if-ge v4, p3, :cond_5
  3657. invoke-virtual {p1, v4}, Ljava/lang/String;->charAt(I)C
  3658. move-result v5
  3659. goto :goto_4
  3660. :cond_5
  3661. const/4 v5, 0x0
  3662. :goto_4
  3663. const v6, 0xdbff
  3664. if-gt v0, v6, :cond_7
  3665. const v6, 0xdc00
  3666. if-lt v5, v6, :cond_7
  3667. if-le v5, v2, :cond_6
  3668. goto :goto_5
  3669. :cond_6
  3670. const/high16 v2, 0x10000
  3671. const v4, -0xd801
  3672. and-int/2addr v0, v4
  3673. shl-int/lit8 v0, v0, 0xa
  3674. const v4, -0xdc01
  3675. and-int/2addr v4, v5
  3676. or-int/2addr v0, v4
  3677. add-int/2addr v0, v2
  3678. shr-int/lit8 v2, v0, 0x12
  3679. or-int/lit16 v2, v2, 0xf0
  3680. invoke-virtual {p0, v2}, Lokio/Buffer;->writeByte(I)Lokio/Buffer;
  3681. shr-int/lit8 v2, v0, 0xc
  3682. and-int/2addr v2, v3
  3683. or-int/2addr v2, v1
  3684. invoke-virtual {p0, v2}, Lokio/Buffer;->writeByte(I)Lokio/Buffer;
  3685. shr-int/lit8 v2, v0, 0x6
  3686. and-int/2addr v2, v3
  3687. or-int/2addr v2, v1
  3688. invoke-virtual {p0, v2}, Lokio/Buffer;->writeByte(I)Lokio/Buffer;
  3689. and-int/2addr v0, v3
  3690. or-int/2addr v0, v1
  3691. invoke-virtual {p0, v0}, Lokio/Buffer;->writeByte(I)Lokio/Buffer;
  3692. add-int/lit8 p2, p2, 0x2
  3693. goto/16 :goto_0
  3694. :cond_7
  3695. :goto_5
  3696. invoke-virtual {p0, v3}, Lokio/Buffer;->writeByte(I)Lokio/Buffer;
  3697. move p2, v4
  3698. goto/16 :goto_0
  3699. :cond_8
  3700. :goto_6
  3701. shr-int/lit8 v2, v0, 0xc
  3702. or-int/lit16 v2, v2, 0xe0
  3703. invoke-virtual {p0, v2}, Lokio/Buffer;->writeByte(I)Lokio/Buffer;
  3704. shr-int/lit8 v2, v0, 0x6
  3705. and-int/2addr v2, v3
  3706. or-int/2addr v2, v1
  3707. goto :goto_3
  3708. :cond_9
  3709. return-object p0
  3710. :cond_a
  3711. new-instance p2, Ljava/lang/IllegalArgumentException;
  3712. new-instance v0, Ljava/lang/StringBuilder;
  3713. invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
  3714. const-string v1, "endIndex > string.length: "
  3715. invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
  3716. invoke-virtual {v0, p3}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
  3717. const-string p3, " > "
  3718. invoke-virtual {v0, p3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
  3719. invoke-virtual {p1}, Ljava/lang/String;->length()I
  3720. move-result p1
  3721. invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
  3722. invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
  3723. move-result-object p1
  3724. invoke-direct {p2, p1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
  3725. throw p2
  3726. :cond_b
  3727. new-instance p1, Ljava/lang/IllegalArgumentException;
  3728. new-instance v0, Ljava/lang/StringBuilder;
  3729. invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
  3730. const-string v1, "endIndex < beginIndex: "
  3731. invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
  3732. invoke-virtual {v0, p3}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
  3733. const-string p3, " < "
  3734. invoke-virtual {v0, p3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
  3735. invoke-virtual {v0, p2}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
  3736. invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
  3737. move-result-object p2
  3738. invoke-direct {p1, p2}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
  3739. throw p1
  3740. :cond_c
  3741. new-instance p1, Ljava/lang/IllegalArgumentException;
  3742. new-instance p3, Ljava/lang/StringBuilder;
  3743. invoke-direct {p3}, Ljava/lang/StringBuilder;-><init>()V
  3744. const-string v0, "beginIndex < 0: "
  3745. invoke-virtual {p3, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
  3746. invoke-virtual {p3, p2}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
  3747. invoke-virtual {p3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
  3748. move-result-object p2
  3749. invoke-direct {p1, p2}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
  3750. throw p1
  3751. :cond_d
  3752. new-instance p1, Ljava/lang/IllegalArgumentException;
  3753. const-string p2, "string == null"
  3754. invoke-direct {p1, p2}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
  3755. goto :goto_8
  3756. :goto_7
  3757. throw p1
  3758. :goto_8
  3759. goto :goto_7
  3760. .end method
  3761. .method public bridge synthetic writeUtf8(Ljava/lang/String;)Lokio/BufferedSink;
  3762. .locals 0
  3763. .annotation system Ldalvik/annotation/Throws;
  3764. value = {
  3765. Ljava/io/IOException;
  3766. }
  3767. .end annotation
  3768. invoke-virtual {p0, p1}, Lokio/Buffer;->writeUtf8(Ljava/lang/String;)Lokio/Buffer;
  3769. move-result-object p1
  3770. return-object p1
  3771. .end method
  3772. .method public bridge synthetic writeUtf8(Ljava/lang/String;II)Lokio/BufferedSink;
  3773. .locals 0
  3774. .annotation system Ldalvik/annotation/Throws;
  3775. value = {
  3776. Ljava/io/IOException;
  3777. }
  3778. .end annotation
  3779. invoke-virtual {p0, p1, p2, p3}, Lokio/Buffer;->writeUtf8(Ljava/lang/String;II)Lokio/Buffer;
  3780. move-result-object p1
  3781. return-object p1
  3782. .end method
  3783. .method public writeUtf8CodePoint(I)Lokio/Buffer;
  3784. .locals 3
  3785. const/16 v0, 0x80
  3786. if-ge p1, v0, :cond_0
  3787. :goto_0
  3788. invoke-virtual {p0, p1}, Lokio/Buffer;->writeByte(I)Lokio/Buffer;
  3789. goto :goto_3
  3790. :cond_0
  3791. const/16 v1, 0x800
  3792. const/16 v2, 0x3f
  3793. if-ge p1, v1, :cond_1
  3794. shr-int/lit8 v1, p1, 0x6
  3795. or-int/lit16 v1, v1, 0xc0
  3796. :goto_1
  3797. invoke-virtual {p0, v1}, Lokio/Buffer;->writeByte(I)Lokio/Buffer;
  3798. and-int/2addr p1, v2
  3799. or-int/2addr p1, v0
  3800. goto :goto_0
  3801. :cond_1
  3802. const/high16 v1, 0x10000
  3803. if-ge p1, v1, :cond_3
  3804. const v1, 0xd800
  3805. if-lt p1, v1, :cond_2
  3806. const v1, 0xdfff
  3807. if-gt p1, v1, :cond_2
  3808. invoke-virtual {p0, v2}, Lokio/Buffer;->writeByte(I)Lokio/Buffer;
  3809. goto :goto_3
  3810. :cond_2
  3811. shr-int/lit8 v1, p1, 0xc
  3812. or-int/lit16 v1, v1, 0xe0
  3813. goto :goto_2
  3814. :cond_3
  3815. const v1, 0x10ffff
  3816. if-gt p1, v1, :cond_4
  3817. shr-int/lit8 v1, p1, 0x12
  3818. or-int/lit16 v1, v1, 0xf0
  3819. invoke-virtual {p0, v1}, Lokio/Buffer;->writeByte(I)Lokio/Buffer;
  3820. shr-int/lit8 v1, p1, 0xc
  3821. and-int/2addr v1, v2
  3822. or-int/2addr v1, v0
  3823. :goto_2
  3824. invoke-virtual {p0, v1}, Lokio/Buffer;->writeByte(I)Lokio/Buffer;
  3825. shr-int/lit8 v1, p1, 0x6
  3826. and-int/2addr v1, v2
  3827. or-int/2addr v1, v0
  3828. goto :goto_1
  3829. :goto_3
  3830. return-object p0
  3831. :cond_4
  3832. new-instance v0, Ljava/lang/IllegalArgumentException;
  3833. new-instance v1, Ljava/lang/StringBuilder;
  3834. invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
  3835. const-string v2, "Unexpected code point: "
  3836. invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
  3837. invoke-static {p1}, Ljava/lang/Integer;->toHexString(I)Ljava/lang/String;
  3838. move-result-object p1
  3839. invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
  3840. invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
  3841. move-result-object p1
  3842. invoke-direct {v0, p1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
  3843. goto :goto_5
  3844. :goto_4
  3845. throw v0
  3846. :goto_5
  3847. goto :goto_4
  3848. .end method
  3849. .method public bridge synthetic writeUtf8CodePoint(I)Lokio/BufferedSink;
  3850. .locals 0
  3851. .annotation system Ldalvik/annotation/Throws;
  3852. value = {
  3853. Ljava/io/IOException;
  3854. }
  3855. .end annotation
  3856. invoke-virtual {p0, p1}, Lokio/Buffer;->writeUtf8CodePoint(I)Lokio/Buffer;
  3857. move-result-object p1
  3858. return-object p1
  3859. .end method