46 Star 173 Fork 4.7K

OpenHarmony/interface_sdk-js

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
@ohos.buffer.d.ts 187.87 KB
一键复制 编辑 原始数据 按行查看 历史
chengyuli 提交于 27天前 . #ICPT5B
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852
/*
* Copyright (c) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (The type of "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @file
* @kit ArkTS
*/
/**
* The Buffer class is a global type for dealing with binary data directly. It can be constructed in a variety of ways.
*
* @namespace buffer
* @syscap SystemCapability.Utils.Lang
* @since 9
*/
/**
* The Buffer class is a global type for dealing with binary data directly. It can be constructed in a variety of ways.
*
* @namespace buffer
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* The Buffer class is a global type for dealing with binary data directly. It can be constructed in a variety of ways.
*
* @namespace buffer
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'11', '1.2':'20'}
* @arkts 1.1&1.2
*/
declare namespace buffer {
/**
* This parameter specifies the type of a common encoding format.
*
* @typedef { 'ascii' | 'utf8' | 'utf-8' | 'utf16le' | 'ucs2' | 'ucs-2' | 'base64' | 'base64url' | 'latin1' | 'binary' | 'hex' }
* @syscap SystemCapability.Utils.Lang
* @since 9
*/
/**
* This parameter specifies the type of a common encoding format.
*
* @typedef { 'ascii' | 'utf8' | 'utf-8' | 'utf16le' | 'ucs2' | 'ucs-2' | 'base64' | 'base64url' | 'latin1' | 'binary' | 'hex' }
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Enumerates the supported encoding formats.
*
* @typedef { 'ascii' | 'utf8' | 'utf-8' | 'utf16le' | 'ucs2' | 'ucs-2' | 'base64' | 'base64url' | 'latin1' | 'binary' | 'hex' }
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'11', '1.2':'20'}
* @arkts 1.1&1.2
*/
type BufferEncoding =
| 'ascii'
| 'utf8'
| 'utf-8'
| 'utf16le'
| 'ucs2'
| 'ucs-2'
| 'base64'
| 'base64url'
| 'latin1'
| 'binary'
| 'hex';
/**
* TypedArray inherits the features and methods of Int8Array
*
* @syscap SystemCapability.Utils.Lang
* @since 9
*/
/**
* TypedArray inherits the features and methods of Int8Array
*
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* TypedArray inherits the features and methods of Int8Array
*
* @extends Int8Array
* @typedef TypedArray
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since 11
*/
interface TypedArray extends Int8Array {}
/**
* TypedArray features and methods
*
* @typedef { Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array | BigInt64Array | BigUint64Array }
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since 20
* @arkts 1.2
*/
type TypedArray = Int8Array
| Uint8Array
| Uint8ClampedArray
| Int16Array
| Uint16Array
| Int32Array
| Uint32Array
| Float32Array
| Float64Array
| BigInt64Array
| BigUint64Array;
/**
* Allocates a new Buffer for a fixed size bytes. If fill is undefined, the Buffer will be zero-filled.
*
* @param { number } size - size size The desired length of the new Buffer
* @param { string | Buffer | number } [fill] - fill [fill=0] A value to pre-fill the new Buffer with
* @param { BufferEncoding } [encoding] - encoding [encoding='utf8'] If `fill` is a string, this is its encoding
* @returns { Buffer } Return a new allocated Buffer
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types;
* 3.Parameter verification failed.
* @syscap SystemCapability.Utils.Lang
* @since 9
*/
/**
* Creates and initializes a Buffer instance of the specified length.
*
* @param { number } size - Size of the Buffer instance to create, in bytes.
* @param { string | Buffer | number } [fill] - Value to be filled in the buffer. The default value is 0.
* @param { BufferEncoding } [encoding] - Encoding format (valid only when fill is a string). The default value is 'utf8'.
* @returns { Buffer } Return a new allocated Buffer
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types;
* 3.Parameter verification failed.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Creates and initializes a Buffer instance of the specified length.
*
* @param { number } size - Size of the Buffer instance to create, in bytes.
* @param { string | Buffer | number } [fill] - Value to be filled in the buffer. The default value is 0.
* @param { BufferEncoding } [encoding] - Encoding format (valid only when fill is a string). The default value is 'utf8'.
* @returns { Buffer } Return a new allocated Buffer
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types;
* 3.Parameter verification failed.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'11', '1.2':'20'}
* @arkts 1.1&1.2
*/
function alloc(size: number, fill?: string | Buffer | number, encoding?: BufferEncoding): Buffer;
/**
* Allocates a new Buffer for a fixed size bytes. The Buffer will not be initially filled.
*
* @param { number } size - size size The desired length of the new Buffer
* @returns { Buffer } Return a new allocated Buffer
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types;
* 3.Parameter verification failed.
* @syscap SystemCapability.Utils.Lang
* @since 9
*/
/**
* Creates a Buffer instance of the specified size from the buffer pool, without initializing it.
* You need to use fill() to initialize the Buffer instance created.
*
* @param { number } size - Size of the Buffer instance to create, in bytes.
* @returns { Buffer } Return a new allocated Buffer
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types;
* 3.Parameter verification failed.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Creates a Buffer instance of the specified size from the buffer pool, without initializing it.
* You need to use fill() to initialize the Buffer instance created.
*
* @param { number } size - Size of the Buffer instance to create, in bytes.
* @returns { Buffer } Return a new allocated Buffer
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types;
* 3.Parameter verification failed.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'11', '1.2':'20'}
* @arkts 1.1&1.2
*/
function allocUninitializedFromPool(size: number): Buffer;
/**
* Allocates a new un-pooled Buffer for a fixed size bytes. The Buffer will not be initially filled.
*
* @param { number } size - size size The desired length of the new Buffer
* @returns { Buffer } Return a new allocated Buffer
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types;
* 3.Parameter verification failed.
* @syscap SystemCapability.Utils.Lang
* @since 9
*/
/**
* Creates a Buffer instance of the specified size, without initializing it.
*
* @param { number } size - Size of the Buffer instance to create, in bytes.
* @returns { Buffer } Return a new allocated Buffer
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types;
* 3.Parameter verification failed.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Creates a Buffer instance of the specified size, without initializing it.
*
* @param { number } size - Size of the Buffer instance to create, in bytes.
* @returns { Buffer } Return a new allocated Buffer
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types;
* 3.Parameter verification failed.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'11', '1.2':'20'}
* @arkts 1.1&1.2
*/
function allocUninitialized(size: number): Buffer;
/**
* Returns the byte length of a string when encoded using `encoding`.
* This is not the same as [`String.prototype.length`], which does not account
* for the encoding that is used to convert the string into bytes.
*
* @param { string | Buffer | TypedArray | DataView | ArrayBuffer | SharedArrayBuffer } string - string string A value to calculate the length of
* @param { BufferEncoding } [encoding] - encoding [encoding='utf8'] If `string` is a string, this is its encoding
* @returns { number } The number of bytes contained within `string`
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @syscap SystemCapability.Utils.Lang
* @since 9
*/
/**
* Returns the byte length of a string when encoded using `encoding`.
* This is not the same as [`String.prototype.length`], which does not account
* for the encoding that is used to convert the string into bytes.
*
* @param { string | Buffer | TypedArray | DataView | ArrayBuffer | SharedArrayBuffer } string - string string A value to calculate the length of
* @param { BufferEncoding } [encoding] - encoding [encoding='utf8'] If `string` is a string, this is its encoding
* @returns { number } The number of bytes contained within `string`
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Obtains the number of bytes of a string based on the encoding format.
*
* @param { string | Buffer | TypedArray | DataView | ArrayBuffer | SharedArrayBuffer } string - Target string.
* @param { BufferEncoding } [encoding] - Encoding format of the string. The default value is 'utf8'.
* @returns { number } The number of bytes contained within `string`
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since 11
*/
function byteLength(
string: string | Buffer | TypedArray | DataView | ArrayBuffer | SharedArrayBuffer,
encoding?: BufferEncoding
): number;
/**
* Obtains the number of bytes of a string based on the encoding format.
*
* @param { string | Buffer | TypedArray | DataView | ArrayBuffer } doc - Target string.
* @param { BufferEncoding } [encoding] - Encoding format of the string. The default value is 'utf8'.
* @returns { number } The number of bytes contained within `string`
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since 20
* @arkts 1.2
*/
function byteLength(
doc: string | Buffer | TypedArray | DataView | ArrayBuffer,
encoding?: BufferEncoding
): number;
/**
* Returns a new `Buffer` which is the result of concatenating all the `Buffer`instances in the `list` together.
*
* @param { Buffer[] | Uint8Array[] } list - list list List of `Buffer` or Uint8Array instances to concatenate
* @param { number } [totalLength] - totalLength totalLength Total length of the `Buffer` instances in `list` when concatenated
* @returns { Buffer } Return a new allocated Buffer
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types;
* 3.Parameter verification failed.
* @throws { BusinessError } 10200001 - The value of "length" is out of range. It must be >= 0 and <= uint32 max. Received value is: [length]
* @syscap SystemCapability.Utils.Lang
* @since 9
*/
/**
* Concatenates an array of Buffer instances of the specified length into a new instance.
*
* @param { Buffer[] | Uint8Array[] } list - Array of instances to concatenate.
* @param { number } [totalLength] - Total length of bytes to be copied. The default value is 0.
* @returns { Buffer } Return a new allocated Buffer
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types;
* 3.Parameter verification failed.
* @throws { BusinessError } 10200001 - The value of "length" is out of range. It must be >= 0 and <= uint32 max. Received value is: [length]
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Concatenates an array of Buffer instances of the specified length into a new instance.
*
* @param { Buffer[] | Uint8Array[] } list - Array of instances to concatenate.
* @param { number } [totalLength] - Total length of bytes to be copied. The default value is 0.
* @returns { Buffer } Return a new allocated Buffer
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types;
* 3.Parameter verification failed.
* @throws { BusinessError } 10200001 - The value of "length" is out of range. It must be >= 0 and <= uint32 max. Received value is: [length]
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'11', '1.2':'20'}
* @arkts 1.1&1.2
*/
function concat(list: Buffer[] | Uint8Array[], totalLength?: number): Buffer;
/**
* Allocates a new Buffer using an array of bytes in the range 0 – 255. Array entries outside that range will be truncated to fit into it.
*
* @param { number[] } array - array array an array of bytes in the range 0 – 255
* @returns { Buffer } Return a new allocated Buffer
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @syscap SystemCapability.Utils.Lang
* @since 9
*/
/**
* Creates a Buffer instance with the specified array.
*
* @param { number[] } array - Array to create a Buffer instance.
* @returns { Buffer } Return a new allocated Buffer
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Creates a Buffer instance with the specified array.
*
* @param { number[] } array - Array to create a Buffer instance.
* @returns { Buffer } Return a new allocated Buffer
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'11', '1.2':'20'}
* @arkts 1.1&1.2
*/
function from(array: number[]): Buffer;
/**
* This creates a view of the ArrayBuffer without copying the underlying memory.
*
* @param { ArrayBuffer | SharedArrayBuffer } arrayBuffer - arrayBuffer arrayBuffer An ArrayBuffer,
* SharedArrayBuffer, for example the .buffer property of a TypedArray.
* @param { number } [byteOffset] - byteOffset [byteOffset = 0] Index of first byte to expose
* @param { number } [length] - length [length = arrayBuffer.byteLength - byteOffset] Number of bytes to expose
* @returns { Buffer } Return a view of the ArrayBuffer
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @throws { BusinessError } 10200001 - The value of "[byteOffset/length]" is out of range.
* It must be >= [left range] and <= [right range]. Received value is: [byteOffset/length]
* @syscap SystemCapability.Utils.Lang
* @since 9
*/
/**
* This creates a view of the ArrayBuffer without copying the underlying memory.
*
* @param { ArrayBuffer | SharedArrayBuffer } arrayBuffer - arrayBuffer arrayBuffer An ArrayBuffer,
* SharedArrayBuffer, for example the .buffer property of a TypedArray.
* @param { number } [byteOffset] - byteOffset [byteOffset = 0] Index of first byte to expose
* @param { number } [length] - length [length = arrayBuffer.byteLength - byteOffset] Number of bytes to expose
* @returns { Buffer } Return a view of the ArrayBuffer
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @throws { BusinessError } 10200001 - The value of "[byteOffset/length]" is out of range.
* It must be >= [left range] and <= [right range]. Received value is: [byteOffset/length]
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* This creates a view of the ArrayBuffer without copying the underlying memory.
*
* @param { ArrayBuffer | SharedArrayBuffer } arrayBuffer - arrayBuffer arrayBuffer An ArrayBuffer,
* SharedArrayBuffer, for example the .buffer property of a TypedArray.
* @param { number } [byteOffset] - byteOffset [byteOffset = 0] Index of first byte to expose
* @param { number } [length] - length [length = arrayBuffer.byteLength - byteOffset] Number of bytes to expose
* @returns { Buffer } Return a view of the ArrayBuffer
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @throws { BusinessError } 10200001 - The value of "[byteOffset/length]" is out of range.
* It must be >= [left range] and <= [right range]. Received value is: [byteOffset/length]
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since 11
*/
function from(arrayBuffer: ArrayBuffer | SharedArrayBuffer, byteOffset?: number, length?: number): Buffer;
/**
* This creates a view of the ArrayBuffer without copying the underlying memory.
*
* @param { ArrayBuffer } arrayBuffer - arrayBuffer arrayBuffer An ArrayBuffer,
* @param { number } [byteOffset] - byteOffset [byteOffset = 0] Index of first byte to expose
* @param { number } [length] - length [length = arrayBuffer.byteLength - byteOffset] Number of bytes to expose
* @returns { Buffer } Return a view of the ArrayBuffer
* @throws { BusinessError } 10200001 - The value of "[byteOffset/length]" is out of range.
* It must be >= [left range] and <= [right range]. Received value is: [byteOffset/length]
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since 20
* @arkts 1.2
*/
function from(arrayBuffer: ArrayBuffer, byteOffset?: number, length?: number): Buffer;
/**
* Copies the passed buffer data onto a new Buffer instance.
*
* @param { Buffer | Uint8Array } buffer - buffer buffer An existing Buffer or Uint8Array from which to copy data
* @returns { Buffer } Return a new allocated Buffer
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @syscap SystemCapability.Utils.Lang
* @since 9
*/
/**
* Copies the data of a passed Buffer instance to create a new Buffer instance and returns the new one.
*
* @param { Buffer | Uint8Array } buffer - Buffer or Uint8Array instance.
* @returns { Buffer } Return a new allocated Buffer
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Copies the data of a passed Buffer instance to create a new Buffer instance and returns the new one.
*
* @param { Buffer | Uint8Array } buffer - Buffer or Uint8Array instance.
* @returns { Buffer } Return a new allocated Buffer
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'11', '1.2':'20'}
* @arkts 1.1&1.2
*/
function from(buffer: Buffer | Uint8Array): Buffer;
/**
* For the object whose value returned by valueof() function is strictly equal to object
* or supports symbol To primitive object, a new buffer instance is created.
*
* @param { Object } object - object object An object supporting Symbol.toPrimitive or valueOf()
* @param { number | string } offsetOrEncoding - offsetOrEncoding offsetOrEncoding A byte-offset or encoding
* @param { number } length - length length A length
* @returns { Buffer } Return a new allocated Buffer
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @syscap SystemCapability.Utils.Lang
* @since 9
*/
/**
* Creates a Buffer instance based on the specified object.
*
* @param { Object } object - Object that supports Symbol.toPrimitive or valueOf().
* @param { number | string } offsetOrEncoding - Byte offset or encoding format.
* @param { number } length - Length of the Buffer instance to create, in bytes.
* @returns { Buffer } Return a new allocated Buffer
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Creates a Buffer instance based on the specified object.
*
* @param { Object } object - Object that supports Symbol.toPrimitive or valueOf().
* @param { number | string } offsetOrEncoding - Byte offset or encoding format.
* @param { number } length - Length of the Buffer instance to create, in bytes.
* @returns { Buffer } Return a new allocated Buffer
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'11', '1.2':'20'}
* @arkts 1.1&1.2
*/
function from(object: Object, offsetOrEncoding: number | string, length: number): Buffer;
/**
* Creates a new Buffer containing string. The encoding parameter identifies the character encoding
* to be used when converting string into bytes.
*
* @param { String } string - string string A string to encode
* @param { BufferEncoding } [encoding] - encoding [encoding='utf8'] The encoding of string
* @returns { Buffer } Return a new Buffer containing string
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @syscap SystemCapability.Utils.Lang
* @since 9
*/
/**
* Creates a Buffer instance based on a string in the given encoding format.
*
* @param { String } string - String.
* @param { BufferEncoding } [encoding] - Encoding format of the string. The default value is 'utf8'.
* @returns { Buffer } Return a new Buffer containing string
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Creates a Buffer instance based on a string in the given encoding format.
*
* @param { String } string - String.
* @param { BufferEncoding } [encoding] - Encoding format of the string. The default value is 'utf8'.
* @returns { Buffer } Return a new Buffer containing string
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'11', '1.2':'20'}
* @arkts 1.1&1.2
*/
function from(string: String, encoding?: BufferEncoding): Buffer;
/**
* Returns true if obj is a Buffer, false otherwise
*
* @param { Object } obj - obj obj Objects to be judged
* @returns { boolean } true or false
* @syscap SystemCapability.Utils.Lang
* @since 9
*/
/**
* Checks whether the specified object is a Buffer instance.
*
* @param { Object } obj - Object to check.
* @returns { boolean } true or false
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Checks whether the specified object is a Buffer instance.
*
* @param { Object } obj - Object to check.
* @returns { boolean } true or false
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'11', '1.2':'20'}
* @arkts 1.1&1.2
*/
function isBuffer(obj: Object): boolean;
/**
* Returns true if encoding is the name of a supported character encoding, or false otherwise.
*
* @param { string } encoding - encoding encoding A character encoding name to check
* @returns { boolean } true or false
* @syscap SystemCapability.Utils.Lang
* @since 9
*/
/**
* Checks whether the encoding format is supported.
*
* @param { string } encoding - Encoding format.
* @returns { boolean } true or false
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Checks whether the encoding format is supported.
*
* @param { string } encoding - Encoding format.
* @returns { boolean } true or false
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'11', '1.2':'20'}
* @arkts 1.1&1.2
*/
function isEncoding(encoding: string): boolean;
/**
* Compares buf1 to buf2
*
* @param { Buffer | Uint8Array } buf1 - buf1 buf1 A Buffer or Uint8Array instance.
* @param { Buffer | Uint8Array } buf2 - buf2 buf2 A Buffer or Uint8Array instance.
* @returns { -1 | 0 | 1 } 0 is returned if target is the same as buf
* 1 is returned if target should come before buf when sorted.
* -1 is returned if target should come after buf when sorted.
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @syscap SystemCapability.Utils.Lang
* @since 9
*/
/**
* Compares buf1 to buf2
*
* @param { Buffer | Uint8Array } buf1 - buf1 buf1 A Buffer or Uint8Array instance.
* @param { Buffer | Uint8Array } buf2 - buf2 buf2 A Buffer or Uint8Array instance.
* @returns { -1 | 0 | 1 } 0 is returned if target is the same as buf
* 1 is returned if target should come before buf when sorted.
* -1 is returned if target should come after buf when sorted.
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Compares buf1 to buf2
*
* @param { Buffer | Uint8Array } buf1 - buf1 buf1 A Buffer or Uint8Array instance.
* @param { Buffer | Uint8Array } buf2 - buf2 buf2 A Buffer or Uint8Array instance.
* @returns { -1 | 0 | 1 } 0 is returned if target is the same as buf
* 1 is returned if target should come before buf when sorted.
* -1 is returned if target should come after buf when sorted.
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since 11
*/
function compare(buf1: Buffer | Uint8Array, buf2: Buffer | Uint8Array): -1 | 0 | 1;
/**
* Compares buf1 to buf2
*
* @param { Buffer | Uint8Array } buf1 - buf1 buf1 A Buffer or Uint8Array instance.
* @param { Buffer | Uint8Array } buf2 - buf2 buf2 A Buffer or Uint8Array instance.
* @returns { number } 0 is returned if target is the same as buf
* 1 is returned if target should come before buf when sorted.
* -1 is returned if target should come after buf when sorted.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since 20
* @arkts 1.2
*/
function compare(buf1: Buffer | Uint8Array, buf2: Buffer | Uint8Array): number;
/**
* Re-encodes the given Buffer or Uint8Array instance from one character encoding to another.
*
* @param { Buffer | Uint8Array } source - source source A Buffer or Uint8Array instance.
* @param { string } fromEnc - fromEnc fromEnc The current encoding
* @param { string } toEnc - toEnc toEnc To target encoding
* @returns { Buffer } Returns a new Buffer instance
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @syscap SystemCapability.Utils.Lang
* @since 9
*/
/**
* Transcodes the given Buffer or Uint8Array object from one encoding format to another.
*
* @param { Buffer | Uint8Array } source - Instance to encode.
* @param { string } fromEnc - Current encoding format
* @param { string } toEnc - Target encoding format.
* @returns { Buffer } Returns a new Buffer instance
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Transcodes the given Buffer or Uint8Array object from one encoding format to another.
*
* @param { Buffer | Uint8Array } source - Instance to encode.
* @param { string } fromEnc - Current encoding format
* @param { string } toEnc - Target encoding format.
* @returns { Buffer } Returns a new Buffer instance
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'11', '1.2':'20'}
* @arkts 1.1&1.2
*/
function transcode(source: Buffer | Uint8Array, fromEnc: string, toEnc: string): Buffer;
/**
* The Buffer object is a method of handling buffers dedicated to binary data.
*
* @syscap SystemCapability.Utils.Lang
* @since 9
*/
/**
* The Buffer object is a method of handling buffers dedicated to binary data.
*
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* The Buffer object is a method of handling buffers dedicated to binary data.
*
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'11', '1.2':'20'}
* @arkts 1.1&1.2
*/
class Buffer {
/**
* Returns the number of bytes in buf
*
* @type { number }
* @throws { BusinessError } 10200013 - Length cannot be set for the buffer that has only a getter.
* @syscap SystemCapability.Utils.Lang
* @since 9
*/
/**
* Returns the number of bytes in buf
*
* @type { number }
* @throws { BusinessError } 10200013 - Length cannot be set for the buffer that has only a getter.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Returns the number of bytes in buf
*
* @type { number }
* @throws { BusinessError } 10200013 - Length cannot be set for the buffer that has only a getter.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since 11
*/
length: number;
/**
* Gets the element number of the buffer.
*
* @type { number }
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since 20
* @arkts 1.2
*/
get length(): number;
/**
* The underlying ArrayBuffer object based on which this Buffer object is created.
*
* @type { ArrayBuffer }
* @throws { BusinessError } 10200013 - Buffer cannot be set for the buffer that has only a getter.
* @syscap SystemCapability.Utils.Lang
* @since 9
*/
/**
* The underlying ArrayBuffer object based on which this Buffer object is created.
*
* @type { ArrayBuffer }
* @throws { BusinessError } 10200013 - Buffer cannot be set for the buffer that has only a getter.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* The underlying ArrayBuffer object based on which this Buffer object is created.
*
* @type { ArrayBuffer }
* @throws { BusinessError } 10200013 - Buffer cannot be set for the buffer that has only a getter.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since 11
*/
buffer: ArrayBuffer;
/**
* The underlying ArrayBuffer object based on which this Buffer object is created.
*
* @type { ArrayBuffer }
* @throws { BusinessError } 10200013 - Buffer cannot be set for the buffer that has only a getter.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since 20
* @arkts 1.2
*/
get buffer(): ArrayBuffer;
/**
* The byteOffset of the Buffers underlying ArrayBuffer object
*
* @type { number }
* @throws { BusinessError } 10200013 - ByteOffset cannot be set for the buffer that has only a getter.
* @syscap SystemCapability.Utils.Lang
* @since 9
*/
/**
* The byteOffset of the Buffers underlying ArrayBuffer object
*
* @type { number }
* @throws { BusinessError } 10200013 - ByteOffset cannot be set for the buffer that has only a getter.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* The byteOffset of the Buffers underlying ArrayBuffer object
*
* @type { number }
* @throws { BusinessError } 10200013 - ByteOffset cannot be set for the buffer that has only a getter.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since 11
*/
byteOffset: number;
/**
* The byteOffset of the Buffers underlying ArrayBuffer object
*
* @type { number }
* @throws { BusinessError } 10200013 - ByteOffset cannot be set for the buffer that has only a getter.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since 20
* @arkts 1.2
*/
get byteOffset(): number;
/**
* Fills buf with the specified value. If the offset and end are not given, the entire buf will be filled.
*
* @param { string | Buffer | Uint8Array | number } value - value value The value with which to fill buf
* @param { number } [offset] - offset [offset = 0] Number of bytes to skip before starting to fill buf
* @param { number } [end] - end [end = buf.length] Where to stop filling buf (not inclusive)
* @param { BufferEncoding } [encoding] - encoding [encoding='utf8'] The encoding for value if value is a string
* @returns { Buffer } A reference to buf
* @throws { BusinessError } 10200001 - The value of "[offset/end]" is out of range. It must be >= 0 and <= [right range]. Received value is: [offset/end]
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Incorrect parameter types;
* 2.Parameter verification failed.
* @syscap SystemCapability.Utils.Lang
* @since 9
*/
/**
* Fills this Buffer instance at the specified position. By default, data is filled cyclically.
*
* @param { string | Buffer | Uint8Array | number } value - Value to fill.
* @param { number } [offset] - Offset to the start position in this Buffer instance where data is filled. The default value is 0.
* @param { number } [end] - Offset to the end position in this Buffer instance (not inclusive). The default value is the length of this Buffer instance.
* @param { BufferEncoding } [encoding] - Encoding format (valid only when value is a string). The default value is 'utf8'.
* @returns { Buffer } A reference to buf
* @throws { BusinessError } 10200001 - The value of "[offset/end]" is out of range. It must be >= 0 and <= [right range]. Received value is: [offset/end]
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Incorrect parameter types;
* 2.Parameter verification failed.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Fills this Buffer instance at the specified position. By default, data is filled cyclically.
*
* @param { string | Buffer | Uint8Array | number } value - Value to fill.
* @param { number } [offset] - Offset to the start position in this Buffer instance where data is filled. The default value is 0.
* @param { number } [end] - Offset to the end position in this Buffer instance (not inclusive). The default value is the length of this Buffer instance.
* @param { BufferEncoding } [encoding] - Encoding format (valid only when value is a string). The default value is 'utf8'.
* @returns { Buffer } A reference to buf
* @throws { BusinessError } 10200001 - The value of "[offset/end]" is out of range. It must be >= 0 and <= [right range]. Received value is: [offset/end]
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Incorrect parameter types;
* 2.Parameter verification failed.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'11', '1.2':'20'}
* @arkts 1.1&1.2
*/
fill(
value: string | Buffer | Uint8Array | number,
offset?: number,
end?: number,
encoding?: BufferEncoding
): Buffer;
/**
* Compares buf with target and returns a number indicating whether buf comes before, after,
* or is the same as target in sort order. Comparison is based on the actual sequence of bytes in each Buffer.
*
* @param { Buffer | Uint8Array } target - target target A Buffer or Uint8Array with which to compare buf
* @param { number } [targetStart] - targetStart [targetStart = 0] The offset within target at which to begin comparison
* @param { number } [targetEnd] - targetEnd [targetEnd = target.length] The offset within target at which to end comparison (not inclusive)
* @param { number } [sourceStart] - sourceStart [sourceStart = 0] The offset within buf at which to begin comparison
* @param { number } [sourceEnd] - sourceEnd [sourceEnd = buf.length] The offset within buf at which to end comparison (not inclusive)
* @returns { -1 | 0 | 1 } 0 is returned if target is the same as buf
* 1 is returned if target should come before buf when sorted.
* -1 is returned if target should come after buf when sorted.
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @throws { BusinessError } 10200001 - The value of "[targetStart/targetEnd/sourceStart/sourceEnd]" is out of range.
* It must be >= 0 and <= [right range]. Received value is: [targetStart/targetEnd/sourceStart/sourceEnd]
* @syscap SystemCapability.Utils.Lang
* @since 9
*/
/**
* Compares buf with target and returns a number indicating whether buf comes before, after,
* or is the same as target in sort order. Comparison is based on the actual sequence of bytes in each Buffer.
*
* @param { Buffer | Uint8Array } target - target target A Buffer or Uint8Array with which to compare buf
* @param { number } [targetStart] - targetStart [targetStart = 0] The offset within target at which to begin comparison
* @param { number } [targetEnd] - targetEnd [targetEnd = target.length] The offset within target at which to end comparison (not inclusive)
* @param { number } [sourceStart] - sourceStart [sourceStart = 0] The offset within buf at which to begin comparison
* @param { number } [sourceEnd] - sourceEnd [sourceEnd = buf.length] The offset within buf at which to end comparison (not inclusive)
* @returns { -1 | 0 | 1 } 0 is returned if target is the same as buf
* 1 is returned if target should come before buf when sorted.
* -1 is returned if target should come after buf when sorted.
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @throws { BusinessError } 10200001 - The value of "[targetStart/targetEnd/sourceStart/sourceEnd]" is out of range.
* It must be >= 0 and <= [right range]. Received value is: [targetStart/targetEnd/sourceStart/sourceEnd]
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Compares buf with target and returns a number indicating whether buf comes before, after,
* or is the same as target in sort order. Comparison is based on the actual sequence of bytes in each Buffer.
*
* @param { Buffer | Uint8Array } target - target target A Buffer or Uint8Array with which to compare buf
* @param { number } [targetStart] - targetStart [targetStart = 0] The offset within target at which to begin comparison
* @param { number } [targetEnd] - targetEnd [targetEnd = target.length] The offset within target at which to end comparison (not inclusive)
* @param { number } [sourceStart] - sourceStart [sourceStart = 0] The offset within buf at which to begin comparison
* @param { number } [sourceEnd] - sourceEnd [sourceEnd = buf.length] The offset within buf at which to end comparison (not inclusive)
* @returns { -1 | 0 | 1 } 0 is returned if target is the same as buf
* 1 is returned if target should come before buf when sorted.
* -1 is returned if target should come after buf when sorted.
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @throws { BusinessError } 10200001 - The value of "[targetStart/targetEnd/sourceStart/sourceEnd]" is out of range.
* It must be >= 0 and <= [right range]. Received value is: [targetStart/targetEnd/sourceStart/sourceEnd]
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since 11
*/
compare(
target: Buffer | Uint8Array,
targetStart?: number,
targetEnd?: number,
sourceStart?: number,
sourceEnd?: number
): -1 | 0 | 1;
/**
* Compares buf with target and returns a number indicating whether buf comes before, after,
* or is the same as target in sort order. Comparison is based on the actual sequence of bytes in each Buffer.
*
* @param { Buffer | Uint8Array } target - target target A Buffer or Uint8Array with which to compare buf
* @param { number } [targetStart] - targetStart [targetStart = 0] The offset within target at which to begin comparison
* @param { number } [targetEnd] - targetEnd [targetEnd = target.length] The offset within target at which to end comparison (not inclusive)
* @param { number } [sourceStart] - sourceStart [sourceStart = 0] The offset within buf at which to begin comparison
* @param { number } [sourceEnd] - sourceEnd [sourceEnd = buf.length] The offset within buf at which to end comparison (not inclusive)
* @returns { number } number is returned if target is the same as buf
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @throws { BusinessError } 10200001 - The value of "[targetStart/targetEnd/sourceStart/sourceEnd]" is out of range.
* It must be >= 0 and <= [right range]. Received value is: [targetStart/targetEnd/sourceStart/sourceEnd]
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since 20
* @arkts 1.2
*/
compare(
target: Buffer | Uint8Array,
targetStart?: number,
targetEnd?: number,
sourceStart?: number,
sourceEnd?: number
): number;
/**
* Copies data from a region of buf to a region in target, even if the target memory region overlaps with buf.
* If sourceEnd is greater than the length of the target, the length of the target shall prevail, and the extra part will not be overwritten.
*
* @param { Buffer | Uint8Array } target - target target A Buffer or Uint8Array to copy into
* @param { number } [targetStart] - targetStart [targetStart = 0] The offset within target at which to begin writing
* @param { number } [sourceStart] - sourceStart [sourceStart = 0] The offset within buf from which to begin copying
* @param { number } [sourceEnd] - sourceEnd [sourceEnd = buf.length] The offset within buf at which to stop copying (not inclusive)
* @returns { number } The number of bytes copied
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @throws { BusinessError } 10200001 - The value of "[targetStart/sourceStart/sourceEnd]" is out of range. It must be >= 0.
* Received value is: [targetStart/sourceStart/sourceEnd]
* @syscap SystemCapability.Utils.Lang
* @since 9
*/
/**
* Copies data at the specified position in this Buffer instance to the specified position in another Buffer instance.
*
* @param { Buffer | Uint8Array } target - Instance to which data is copied.
* @param { number } [targetStart] - Offset to the start position in the target instance where data is copied. The default value is 0.
* @param { number } [sourceStart] - Offset to the start position in this Buffer instance where data is copied. The default value is 0.
* @param { number } [sourceEnd] - Offset to the end position in this Buffer instance (not inclusive).
* The default value is the length of this Buffer instance.
* @returns { number } The number of bytes copied
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @throws { BusinessError } 10200001 - The value of "[targetStart/sourceStart/sourceEnd]" is out of range. It must be >= 0.
* Received value is: [targetStart/sourceStart/sourceEnd]
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Copies data at the specified position in this Buffer instance to the specified position in another Buffer instance.
*
* @param { Buffer | Uint8Array } target - Instance to which data is copied.
* @param { number } [targetStart] - Offset to the start position in the target instance where data is copied. The default value is 0.
* @param { number } [sourceStart] - Offset to the start position in this Buffer instance where data is copied. The default value is 0.
* @param { number } [sourceEnd] - Offset to the end position in this Buffer instance (not inclusive).
* The default value is the length of this Buffer instance.
* @returns { number } The number of bytes copied
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @throws { BusinessError } 10200001 - The value of "[targetStart/sourceStart/sourceEnd]" is out of range. It must be >= 0.
* Received value is: [targetStart/sourceStart/sourceEnd]
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'11', '1.2':'20'}
* @arkts 1.1&1.2
*/
copy(target: Buffer | Uint8Array, targetStart?: number, sourceStart?: number, sourceEnd?: number): number;
/**
* Returns true if both buf and otherBuffer have exactly the same bytes, false otherwise
*
* @param { Uint8Array | Buffer } otherBuffer - otherBuffer otherBuffer A Buffer or Uint8Array with which to compare buf
* @returns { boolean } true or false
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types.
* @syscap SystemCapability.Utils.Lang
* @since 9
*/
/**
* Checks whether this Buffer instance is the same as another Buffer instance.
*
* @param { Uint8Array | Buffer } otherBuffer - Buffer instance to compare.
* @returns { boolean } true or false
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Checks whether this Buffer instance is the same as another Buffer instance.
*
* @param { Uint8Array | Buffer } otherBuffer - Buffer instance to compare.
* @returns { boolean } true or false
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'11', '1.2':'20'}
* @arkts 1.1&1.2
*/
equals(otherBuffer: Uint8Array | Buffer): boolean;
/**
* Returns true if value was found in buf, false otherwise
*
* @param { string | number | Buffer | Uint8Array } value - value value What to search for
* @param { number } [byteOffset] - byteOffset [byteOffset = 0] Where to begin searching in buf. If negative, then offset is calculated from the end of buf
* @param { BufferEncoding } [encoding] - encoding [encoding='utf8'] If value is a string, this is its encoding
* @returns { boolean } true or false
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @syscap SystemCapability.Utils.Lang
* @since 9
*/
/**
* Checks whether this Buffer instance contains the specified value.
*
* @param { string | number | Buffer | Uint8Array } value - Value to match.
* @param { number } [byteOffset] - Number of bytes to skip before starting to check data.
* Number of bytes to skip before starting to check data. If the offset is a negative number,
* data is checked from the end of the Buffer instance. The default value is 0.
* @param { BufferEncoding } [encoding] - Encoding format (valid only when value is a string). The default value is 'utf8'.
* @returns { boolean } true or false
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Checks whether this Buffer instance contains the specified value.
*
* @param { string | number | Buffer | Uint8Array } value - Value to match.
* @param { number } [byteOffset] - Number of bytes to skip before starting to check data.
* Number of bytes to skip before starting to check data. If the offset is a negative number,
* data is checked from the end of the Buffer instance. The default value is 0.
* @param { BufferEncoding } [encoding] - Encoding format (valid only when value is a string). The default value is 'utf8'.
* @returns { boolean } true or false
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'11', '1.2':'20'}
* @arkts 1.1&1.2
*/
includes(value: string | number | Buffer | Uint8Array, byteOffset?: number, encoding?: BufferEncoding): boolean;
/**
* The index of the first occurrence of value in buf
*
* @param { string | number | Buffer | Uint8Array } value - value value What to search for
* @param { number } [byteOffset] - byteOffset [byteOffset = 0] Where to begin searching in buf
* @param { BufferEncoding } [encoding] - encoding [encoding='utf8'] If value is a string,
* this is the encoding used to determine the binary representation of the string that will be searched for in buf
* @returns { number } The index of the first occurrence of value in buf, or -1 if buf does not contain value
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @syscap SystemCapability.Utils.Lang
* @since 9
*/
/**
* Obtains the index of the first occurrence of the specified value in this Buffer instance.
*
* @param { string | number | Buffer | Uint8Array } value - Value to match.
* @param { number } [byteOffset] - Number of bytes to skip before starting to check data.
* If the offset is a negative number, data is checked from the end of the Buffer instance. The default value is 0.
* @param { BufferEncoding } [encoding] - Encoding format (valid only when value is a string). The default value is 'utf8'.
* @returns { number } The index of the first occurrence of value in buf, or -1 if buf does not contain value
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Obtains the index of the first occurrence of the specified value in this Buffer instance.
*
* @param { string | number | Buffer | Uint8Array } value - Value to match.
* @param { number } [byteOffset] - Number of bytes to skip before starting to check data.
* If the offset is a negative number, data is checked from the end of the Buffer instance. The default value is 0.
* @param { BufferEncoding } [encoding] - Encoding format (valid only when value is a string). The default value is 'utf8'.
* @returns { number } The index of the first occurrence of value in buf, or -1 if buf does not contain value
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'11', '1.2':'20'}
* @arkts 1.1&1.2
*/
indexOf(value: string | number | Buffer | Uint8Array, byteOffset?: number, encoding?: BufferEncoding): number;
/**
* Creates and returns an iterator of buf keys (indices).
*
* @returns { IterableIterator<number> }
* @syscap SystemCapability.Utils.Lang
* @since 9
*/
/**
* Creates and returns an iterator that contains the keys of this Buffer instance.
*
* @returns { IterableIterator<number> }
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Creates and returns an iterator that contains the keys of this Buffer instance.
*
* @returns { IterableIterator<number> }
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'11', '1.2':'20'}
* @arkts 1.1&1.2
*/
keys(): IterableIterator<number>;
/**
* Creates and returns an iterator for buf values (bytes).
*
* @returns { IterableIterator<number> }
* @syscap SystemCapability.Utils.Lang
* @since 9
*/
/**
* Creates and returns an iterator that contains the values of this Buffer instance.
*
* @returns { IterableIterator<number> }
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Creates and returns an iterator that contains the values of this Buffer instance.
*
* @returns { IterableIterator<number> }
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'11', '1.2':'20'}
* @arkts 1.1&1.2
*/
values(): IterableIterator<number>;
/**
* Creates and returns an iterator of [index, byte] pairs from the contents of buf.
*
* @returns { IterableIterator<[number, number]> }
* @syscap SystemCapability.Utils.Lang
* @since 9
*/
/**
* Creates and returns an iterator that contains key-value pairs of this Buffer instance.
*
* @returns { IterableIterator<[number, number]> }
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Creates and returns an iterator that contains key-value pairs of this Buffer instance.
*
* @returns { IterableIterator<[number, number]> }
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'11', '1.2':'20'}
* @arkts 1.1&1.2
*/
entries(): IterableIterator<[number, number]>;
/**
* The index of the last occurrence of value in buf
*
* @param { string | number | Buffer | Uint8Array } value - value value What to search for
* @param { number } [byteOffset] - byteOffset [byteOffset = 0] Where to begin searching in buf
* @param { BufferEncoding } [encoding] - encoding [encoding='utf8'] If value is a string,
* this is the encoding used to determine the binary representation of the string that will be searched for in buf
* @returns { number } The index of the last occurrence of value in buf, or -1 if buf does not contain value
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @syscap SystemCapability.Utils.Lang
* @since 9
*/
/**
* Obtains the index of the last occurrence of the specified value in this Buffer instance.
*
* @param { string | number | Buffer | Uint8Array } value - Value to match.
* @param { number } [byteOffset] - Number of bytes to skip before starting to check data.
* If the offset is a negative number, data is checked from the end of the Buffer instance.
* The default value is the length of this Buffer instance.
* @param { BufferEncoding } [encoding] - Encoding format (valid only when value is a string). The default value is 'utf8'.
* this is the encoding used to determine the binary representation of the string that will be searched for in buf
* @returns { number } The index of the last occurrence of value in buf, or -1 if buf does not contain value
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Obtains the index of the last occurrence of the specified value in this Buffer instance.
*
* @param { string | number | Buffer | Uint8Array } value - Value to match.
* @param { number } [byteOffset] - Number of bytes to skip before starting to check data.
* If the offset is a negative number, data is checked from the end of the Buffer instance.
* The default value is the length of this Buffer instance.
* @param { BufferEncoding } [encoding] - Encoding format (valid only when value is a string). The default value is 'utf8'.
* @returns { number } The index of the last occurrence of value in buf, or -1 if buf does not contain value
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'11', '1.2':'20'}
* @arkts 1.1&1.2
*/
lastIndexOf(value: string | number | Buffer | Uint8Array, byteOffset?: number, encoding?: BufferEncoding): number;
/**
* Reads a signed, big-endian 64-bit integer from buf at the specified offset
*
* @param { number } [offset] - offset [offset = 0] Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - 8
* @returns { bigint } Return a signed, big-endian 64-bit integer
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Incorrect parameter types.
* @throws { BusinessError } 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 8. Received value is: [offset]
* @syscap SystemCapability.Utils.Lang
* @since 9
*/
/**
* Reads a 64-bit, big-endian, signed big integer from this Buffer instance at the specified offset.
*
* @param { number } [offset] - Number of bytes to skip before starting to read data. The default value is 0. The value range is [0, Buffer.length - 8].
* @returns { bigint } Return a signed, big-endian 64-bit integer
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Incorrect parameter types.
* @throws { BusinessError } 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 8. Received value is: [offset]
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Reads a 64-bit, big-endian, signed big integer from this Buffer instance at the specified offset.
*
* @param { number } [offset] - Number of bytes to skip before starting to read data. The default value is 0. The value range is [0, Buffer.length - 8].
* @returns { bigint } Return a signed, big-endian 64-bit integer
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Incorrect parameter types.
* @throws { BusinessError } 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 8. Received value is: [offset]
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'11', '1.2':'20'}
* @arkts 1.1&1.2
*/
readBigInt64BE(offset?: number): bigint;
/**
* Reads a signed, little-endian 64-bit integer from buf at the specified offset
*
* @param { number } [offset] - offset [offset = 0] Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - 8
* @returns { bigint } Return a signed, little-endian 64-bit integer
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Incorrect parameter types.
* @throws { BusinessError } 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 8. Received value is: [offset]
* @syscap SystemCapability.Utils.Lang
* @since 9
*/
/**
* Reads a 64-bit, little-endian, signed big integer from this Buffer instance at the specified offset.
*
* @param { number } [offset] - Number of bytes to skip before starting to read data. The default value is 0. The value range is [0, Buffer.length - 8].
* @returns { bigint } Return a signed, little-endian 64-bit integer
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Incorrect parameter types.
* @throws { BusinessError } 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 8. Received value is: [offset]
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Reads a 64-bit, little-endian, signed big integer from this Buffer instance at the specified offset.
*
* @param { number } [offset] - Number of bytes to skip before starting to read data. The default value is 0. The value range is [0, Buffer.length - 8].
* @returns { bigint } Return a signed, little-endian 64-bit integer
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Incorrect parameter types.
* @throws { BusinessError } 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 8. Received value is: [offset]
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'11', '1.2':'20'}
* @arkts 1.1&1.2
*/
readBigInt64LE(offset?: number): bigint;
/**
* Reads a unsigned, big-endian 64-bit integer from buf at the specified offset
*
* @param { number } [offset] - offset [offset = 0] Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - 8
* @returns { bigint } Return a unsigned, big-endian 64-bit integer
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Incorrect parameter types.
* @throws { BusinessError } 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 8. Received value is: [offset]
* @syscap SystemCapability.Utils.Lang
* @since 9
*/
/**
* Reads a 64-bit, big-endian, unsigned big integer from this Buffer instance at the specified offset.
*
* @param { number } [offset] - Number of bytes to skip before starting to read data. The default value is 0. The value range is [0, Buffer.length - 8].
* @returns { bigint } Return a unsigned, big-endian 64-bit integer
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Incorrect parameter types.
* @throws { BusinessError } 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 8. Received value is: [offset]
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Reads a 64-bit, big-endian, unsigned big integer from this Buffer instance at the specified offset.
*
* @param { number } [offset] - Number of bytes to skip before starting to read data. The default value is 0. The value range is [0, Buffer.length - 8].
* @returns { bigint } Return a unsigned, big-endian 64-bit integer
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Incorrect parameter types.
* @throws { BusinessError } 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 8. Received value is: [offset]
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'11', '1.2':'20'}
* @arkts 1.1&1.2
*/
readBigUInt64BE(offset?: number): bigint;
/**
* Reads a unsigned, little-endian 64-bit integer from buf at the specified offset
*
* @param { number } [offset] - offset [offset = 0] Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - 8
* @returns { bigint } Return a unsigned, little-endian 64-bit integer
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Incorrect parameter types.
* @throws { BusinessError } 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 8. Received value is: [offset]
* @syscap SystemCapability.Utils.Lang
* @since 9
*/
/**
* Reads a 64-bit, little-endian, unsigned big integer from this Buffer instance at the specified offset.
*
* @param { number } [offset] - Number of bytes to skip before starting to read data. The default value is 0. The value range is [0, Buffer.length - 8].
* @returns { bigint } Return a unsigned, little-endian 64-bit integer
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Incorrect parameter types.
* @throws { BusinessError } 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 8. Received value is: [offset]
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Reads a 64-bit, little-endian, unsigned big integer from this Buffer instance at the specified offset.
*
* @param { number } [offset] - Number of bytes to skip before starting to read data. The default value is 0. The value range is [0, Buffer.length - 8].
* @returns { bigint } Return a unsigned, little-endian 64-bit integer
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Incorrect parameter types.
* @throws { BusinessError } 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 8. Received value is: [offset]
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'11', '1.2':'20'}
* @arkts 1.1&1.2
*/
readBigUInt64LE(offset?: number): bigint;
/**
* Reads a 64-bit, big-endian double from buf at the specified offset
*
* @param { number } [offset] - offset [offset = 0] Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - 8
* @returns { number } Return a 64-bit, big-endian double
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Incorrect parameter types.
* @throws { BusinessError } 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 8. Received value is: [offset]
* @syscap SystemCapability.Utils.Lang
* @since 9
*/
/**
* Reads a 64-bit, big-endian, double-precision floating-point number from this Buffer instance at the specified offset.
*
* @param { number } [offset] - Number of bytes to skip before starting to read data. The default value is 0. The value range is [0, Buffer.length - 8].
* @returns { number } Return a 64-bit, big-endian double
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Incorrect parameter types.
* @throws { BusinessError } 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 8. Received value is: [offset]
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Reads a 64-bit, big-endian, double-precision floating-point number from this Buffer instance at the specified offset.
*
* @param { number } [offset] - Number of bytes to skip before starting to read data. The default value is 0. The value range is [0, Buffer.length - 8].
* @returns { number } Return a 64-bit, big-endian double
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Incorrect parameter types.
* @throws { BusinessError } 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 8. Received value is: [offset]
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'11', '1.2':'20'}
* @arkts 1.1&1.2
*/
readDoubleBE(offset?: number): number;
/**
* Reads a 64-bit, little-endian double from buf at the specified offset
*
* @param { number } [offset] - offset [offset = 0] Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - 8
* @returns { number } Return a 64-bit, little-endian double
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Incorrect parameter types.
* @throws { BusinessError } 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 8. Received value is: [offset]
* @syscap SystemCapability.Utils.Lang
* @since 9
*/
/**
* Reads a 64-bit, little-endian, double-precision floating-point number from this Buffer instance at the specified offset.
*
* @param { number } [offset] - Number of bytes to skip before starting to read data. The default value is 0. The value range is [0, Buffer.length - 8].
* @returns { number } Return a 64-bit, little-endian double
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Incorrect parameter types.
* @throws { BusinessError } 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 8. Received value is: [offset]
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Reads a 64-bit, little-endian, double-precision floating-point number from this Buffer instance at the specified offset.
*
* @param { number } [offset] - Number of bytes to skip before starting to read data. The default value is 0. The value range is [0, Buffer.length - 8].
* @returns { number } Return a 64-bit, little-endian double
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Incorrect parameter types.
* @throws { BusinessError } 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 8. Received value is: [offset]
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'11', '1.2':'20'}
* @arkts 1.1&1.2
*/
readDoubleLE(offset?: number): number;
/**
* Reads a 32-bit, big-endian float from buf at the specified offset
*
* @param { number } [offset] - offset [offset = 0] Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - 4
* @returns { number } Return a 32-bit, big-endian float
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Incorrect parameter types.
* @throws { BusinessError } 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 4. Received value is: [offset]
* @syscap SystemCapability.Utils.Lang
* @since 9
*/
/**
* Reads a 32-bit, big-endian, single-precision floating-point number from this Buffer instance at the specified offset.
*
* @param { number } [offset] - Number of bytes to skip before starting to read data. The default value is 0. The value range is [0, Buffer.length - 4].
* @returns { number } Return a 32-bit, big-endian float
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Incorrect parameter types.
* @throws { BusinessError } 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 4. Received value is: [offset]
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Reads a 32-bit, big-endian, single-precision floating-point number from this Buffer instance at the specified offset.
*
* @param { number } [offset] - Number of bytes to skip before starting to read data. The default value is 0. The value range is [0, Buffer.length - 4].
* @returns { number } Return a 32-bit, big-endian float
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Incorrect parameter types.
* @throws { BusinessError } 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 4. Received value is: [offset]
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'11', '1.2':'20'}
* @arkts 1.1&1.2
*/
readFloatBE(offset?: number): number;
/**
* Reads a 32-bit, little-endian float from buf at the specified offset
*
* @param { number } [offset] - offset [offset = 0] Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - 4
* @returns { number } Return a 32-bit, little-endian float
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Incorrect parameter types.
* @throws { BusinessError } 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 4. Received value is: [offset]
* @syscap SystemCapability.Utils.Lang
* @since 9
*/
/**
* Reads a 32-bit, little-endian, single-precision floating-point number from this Buffer instance at the specified offset.
*
* @param { number } [offset] - Number of bytes to skip before starting to read data. The default value is 0. The value range is [0, Buffer.length - 4].
* @returns { number } Return a 32-bit, little-endian float
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Incorrect parameter types.
* @throws { BusinessError } 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 4. Received value is: [offset]
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Reads a 32-bit, little-endian, single-precision floating-point number from this Buffer instance at the specified offset.
*
* @param { number } [offset] - Number of bytes to skip before starting to read data. The default value is 0. The value range is [0, Buffer.length - 4].
* @returns { number } Return a 32-bit, little-endian float
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Incorrect parameter types.
* @throws { BusinessError } 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 4. Received value is: [offset]
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'11', '1.2':'20'}
* @arkts 1.1&1.2
*/
readFloatLE(offset?: number): number;
/**
* Reads a signed 8-bit integer from buf at the specified offset
*
* @param { number } [offset] - offset [offset = 0] Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - 1
* @returns { number } Return a signed 8-bit integer
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Incorrect parameter types.
* @throws { BusinessError } 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 1. Received value is: [offset]
* @syscap SystemCapability.Utils.Lang
* @since 9
*/
/**
* Reads an 8-bit signed integer from this Buffer instance at the specified offset.
*
* @param { number } [offset] - Number of bytes to skip before starting to read data. The default value is 0. The value range is [0, Buffer.length - 1].
* @returns { number } Return a signed 8-bit integer
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Incorrect parameter types.
* @throws { BusinessError } 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 1. Received value is: [offset]
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Reads an 8-bit signed integer from this Buffer instance at the specified offset.
*
* @param { number } [offset] - Number of bytes to skip before starting to read data. The default value is 0. The value range is [0, Buffer.length - 1].
* @returns { number } Return a signed 8-bit integer
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Incorrect parameter types.
* @throws { BusinessError } 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 1. Received value is: [offset]
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'11', '1.2':'20'}
* @arkts 1.1&1.2
*/
readInt8(offset?: number): number;
/**
* Reads a signed, big-endian 16-bit integer from buf at the specified offset
*
* @param { number } [offset] - offset [offset = 0] Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - 2
* @returns { number } Return a signed, big-endian 16-bit integer
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Incorrect parameter types.
* @throws { BusinessError } 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 2. Received value is: [offset]
* @syscap SystemCapability.Utils.Lang
* @since 9
*/
/**
* Reads a 16-bit, big-endian, signed integer from this Buffer instance at the specified offset.
*
* @param { number } [offset] - Number of bytes to skip before starting to read data. The default value is 0. The value range is [0, Buffer.length - 2].
* @returns { number } Return a signed, big-endian 16-bit integer
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Incorrect parameter types.
* @throws { BusinessError } 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 2. Received value is: [offset]
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Reads a 16-bit, big-endian, signed integer from this Buffer instance at the specified offset.
*
* @param { number } [offset] - Number of bytes to skip before starting to read data. The default value is 0. The value range is [0, Buffer.length - 2].
* @returns { number } Return a signed, big-endian 16-bit integer
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Incorrect parameter types.
* @throws { BusinessError } 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 2. Received value is: [offset]
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'11', '1.2':'20'}
* @arkts 1.1&1.2
*/
readInt16BE(offset?: number): number;
/**
* Reads a signed, little-endian 16-bit integer from buf at the specified offset
*
* @param { number } [offset] - offset [offset = 0] Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - 2
* @returns { number } Return a signed, little-endian 16-bit integer
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Incorrect parameter types.
* @throws { BusinessError } 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 2. Received value is: [offset]
* @syscap SystemCapability.Utils.Lang
* @since 9
*/
/**
* Reads a 16-bit, little-endian, signed integer from this Buffer instance at the specified offset.
*
* @param { number } [offset] - Number of bytes to skip before starting to read data. The default value is 0. The value range is [0, Buffer.length - 2].
* @returns { number } Return a signed, little-endian 16-bit integer
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Incorrect parameter types.
* @throws { BusinessError } 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 2. Received value is: [offset]
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Reads a 16-bit, little-endian, signed integer from this Buffer instance at the specified offset.
*
* @param { number } [offset] - Number of bytes to skip before starting to read data. The default value is 0. The value range is [0, Buffer.length - 2].
* @returns { number } Return a signed, little-endian 16-bit integer
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Incorrect parameter types.
* @throws { BusinessError } 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 2. Received value is: [offset]
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'11', '1.2':'20'}
* @arkts 1.1&1.2
*/
readInt16LE(offset?: number): number;
/**
* Reads a signed, big-endian 32-bit integer from buf at the specified offset
*
* @param { number } [offset] - offset [offset = 0] Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - 4
* @returns { number } Return a signed, big-endian 32-bit integer
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Incorrect parameter types.
* @throws { BusinessError } 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 4. Received value is: [offset]
* @syscap SystemCapability.Utils.Lang
* @since 9
*/
/**
* Reads a 32-bit, big-endian, signed integer from this Buffer instance at the specified offset.
*
* @param { number } [offset] - Number of bytes to skip before starting to read data. The default value is 0. The value range is [0, Buffer.length - 4].
* @returns { number } Return a signed, big-endian 32-bit integer
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Incorrect parameter types.
* @throws { BusinessError } 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 4. Received value is: [offset]
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Reads a 32-bit, big-endian, signed integer from this Buffer instance at the specified offset.
*
* @param { number } [offset] - Number of bytes to skip before starting to read data. The default value is 0. The value range is [0, Buffer.length - 4].
* @returns { number } Return a signed, big-endian 32-bit integer
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Incorrect parameter types.
* @throws { BusinessError } 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 4. Received value is: [offset]
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'11', '1.2':'20'}
* @arkts 1.1&1.2
*/
readInt32BE(offset?: number): number;
/**
* Reads a signed, little-endian 32-bit integer from buf at the specified offset
*
* @param { number } [offset] - offset [offset = 0] Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - 4
* @returns { number } Return a signed, little-endian 32-bit integer
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Incorrect parameter types.
* @throws { BusinessError } 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 4. Received value is: [offset]
* @syscap SystemCapability.Utils.Lang
* @since 9
*/
/**
* Reads a 32-bit, little-endian, signed integer from this Buffer instance at the specified offset.
*
* @param { number } [offset] - Number of bytes to skip before starting to read data. The default value is 0. The value range is [0, Buffer.length - 4].
* @returns { number } Return a signed, little-endian 32-bit integer
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Incorrect parameter types.
* @throws { BusinessError } 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 4. Received value is: [offset]
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Reads a 32-bit, little-endian, signed integer from this Buffer instance at the specified offset.
*
* @param { number } [offset] - Number of bytes to skip before starting to read data. The default value is 0. The value range is [0, Buffer.length - 4].
* @returns { number } Return a signed, little-endian 32-bit integer
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Incorrect parameter types.
* @throws { BusinessError } 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 4. Received value is: [offset]
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'11', '1.2':'20'}
* @arkts 1.1&1.2
*/
readInt32LE(offset?: number): number;
/**
* Reads byteLength number of bytes from buf at the specified offset and interprets the result as a big-endian,
* two's complement signed value supporting up to 48 bits of accuracy
*
* @param { number } offset - offset offset Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - byteLength
* @param { number } byteLength - byteLength byteLength Number of bytes to read. Must satisfy 0 < byteLength <= 6
* @returns { number }
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @throws { BusinessError } 10200001 - The value of "[param]" is out of range. It must be >= [left range] and <= [right range]. Received value is: [param]
* @syscap SystemCapability.Utils.Lang
* @since 9
*/
/**
* Reads the specified number of bytes from this Buffer instance at the specified offset, and interprets the result as a big-endian,
* two's complement signed value that supports up to 48 bits of precision.
*
* @param { number } offset - Number of bytes to skip before starting to read data.
* The default value is 0. The value range is [0, Buffer.length - byteLength].
* @param { number } byteLength - Number of bytes to read. The value range is [1, 6].
* @returns { number }
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @throws { BusinessError } 10200001 - The value of "[param]" is out of range. It must be >= [left range] and <= [right range]. Received value is: [param]
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Reads the specified number of bytes from this Buffer instance at the specified offset, and interprets the result as a big-endian,
* two's complement signed value that supports up to 48 bits of precision.
*
* @param { number } offset - Number of bytes to skip before starting to read data.
* The default value is 0. The value range is [0, Buffer.length - byteLength].
* @param { number } byteLength - Number of bytes to read. The value range is [1, 6].
* @returns { number }
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @throws { BusinessError } 10200001 - The value of "[param]" is out of range. It must be >= [left range] and <= [right range]. Received value is: [param]
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'11', '1.2':'20'}
* @arkts 1.1&1.2
*/
readIntBE(offset: number, byteLength: number): number;
/**
* Reads byteLength number of bytes from buf at the specified offset and interprets the result as a little-endian,
* two's complement signed value supporting up to 48 bits of accuracy.
*
* @param { number } offset - offset offset Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - byteLength
* @param { number } byteLength - byteLength byteLength Number of bytes to read. Must satisfy 0 < byteLength <= 6
* @returns { number }
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @throws { BusinessError } 10200001 - The value of "[param]" is out of range. It must be >= [left range] and <= [right range]. Received value is: [param]
* @syscap SystemCapability.Utils.Lang
* @since 9
*/
/**
* Reads the specified number of bytes from this Buffer instance at the specified offset and interprets the result as a little-endian,
* two's complement signed value that supports up to 48 bits of precision.
*
* @param { number } offset - Number of bytes to skip before starting to read data.
* The default value is 0. The value range is [0, Buffer.length - byteLength].
* @param { number } byteLength - Number of bytes to read. The value range is [1, 6].
* @returns { number }
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @throws { BusinessError } 10200001 - The value of "[param]" is out of range. It must be >= [left range] and <= [right range]. Received value is: [param]
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Reads the specified number of bytes from this Buffer instance at the specified offset and interprets the result as a little-endian,
* two's complement signed value that supports up to 48 bits of precision.
*
* @param { number } offset - Number of bytes to skip before starting to read data.
* The default value is 0. The value range is [0, Buffer.length - byteLength].
* @param { number } byteLength - Number of bytes to read. The value range is [1, 6].
* @returns { number }
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @throws { BusinessError } 10200001 - The value of "[param]" is out of range. It must be >= [left range] and <= [right range]. Received value is: [param]
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'11', '1.2':'20'}
* @arkts 1.1&1.2
*/
readIntLE(offset: number, byteLength: number): number;
/**
* Reads an unsigned 8-bit integer from buf at the specified offset
*
* @param { number } [offset] - offset [offset = 0] Number of bytes to skip before starting to read. Must satisfy 0 <= offset <= buf.length - 1
* @returns { number } Reads an unsigned 8-bit integer
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Incorrect parameter types.
* @throws { BusinessError } 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 1. Received value is: [offset]
* @syscap SystemCapability.Utils.Lang
* @since 9
*/
/**
* Reads an 8-bit unsigned integer from this Buffer instance at the specified offset.
*
* @param { number } [offset] - Number of bytes to skip before starting to read data. The default value is 0. The value range is [0, Buffer.length - 1].
* @returns { number } Reads an unsigned 8-bit integer
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Incorrect parameter types.
* @throws { BusinessError } 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 1. Received value is: [offset]
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Reads an 8-bit unsigned integer from this Buffer instance at the specified offset.
*
* @param { number } [offset] - Number of bytes to skip before starting to read data. The default value is 0. The value range is [0, Buffer.length - 1].
* @returns { number } Reads an unsigned 8-bit integer
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Incorrect parameter types.
* @throws { BusinessError } 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 1. Received value is: [offset]
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'11', '1.2':'20'}
* @arkts 1.1&1.2
*/
readUInt8(offset?: number): number;
/**
* Reads an unsigned, big-endian 16-bit integer from buf at the specified offset
*
* @param { number } [offset] - offset [offset = 0] Number of bytes to skip before starting to read. Must satisfy 0 <= offset <= buf.length - 2
* @returns { number } Reads an unsigned, big-endian 16-bit integer
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Incorrect parameter types.
* @throws { BusinessError } 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 2. Received value is: [offset]
* @syscap SystemCapability.Utils.Lang
* @since 9
*/
/**
* Reads a 16-bit, big-endian, unsigned integer from this Buffer instance at the specified offset.
*
* @param { number } [offset] - Number of bytes to skip before starting to read data. The default value is 0. The value range is [0, Buffer.length - 2].
* @returns { number } Reads an unsigned, big-endian 16-bit integer
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Incorrect parameter types.
* @throws { BusinessError } 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 2. Received value is: [offset]
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Reads a 16-bit, big-endian, unsigned integer from this Buffer instance at the specified offset.
*
* @param { number } [offset] - Number of bytes to skip before starting to read data. The default value is 0. The value range is [0, Buffer.length - 2].
* @returns { number } Reads an unsigned, big-endian 16-bit integer
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Incorrect parameter types.
* @throws { BusinessError } 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 2. Received value is: [offset]
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'11', '1.2':'20'}
* @arkts 1.1&1.2
*/
readUInt16BE(offset?: number): number;
/**
* Reads an unsigned, little-endian 16-bit integer from buf at the specified offset
*
* @param { number } [offset] - offset [offset = 0] Number of bytes to skip before starting to read. Must satisfy 0 <= offset <= buf.length - 2
* @returns { number } Reads an unsigned, little-endian 16-bit integer
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Incorrect parameter types.
* @throws { BusinessError } 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 2. Received value is: [offset]
* @syscap SystemCapability.Utils.Lang
* @since 9
*/
/**
* Reads a 16-bit, little-endian, unsigned integer from this Buffer instance at the specified offset.
*
* @param { number } [offset] - Number of bytes to skip before starting to read data. The default value is 0. The value range is [0, Buffer.length - 2].
* @returns { number } Reads an unsigned, little-endian 16-bit integer
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Incorrect parameter types.
* @throws { BusinessError } 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 2. Received value is: [offset]
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Reads a 16-bit, little-endian, unsigned integer from this Buffer instance at the specified offset.
*
* @param { number } [offset] - Number of bytes to skip before starting to read data. The default value is 0. The value range is [0, Buffer.length - 2].
* @returns { number } Reads an unsigned, little-endian 16-bit integer
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Incorrect parameter types.
* @throws { BusinessError } 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 2. Received value is: [offset]
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'11', '1.2':'20'}
* @arkts 1.1&1.2
*/
readUInt16LE(offset?: number): number;
/**
* Reads an unsigned, big-endian 32-bit integer from buf at the specified offset
*
* @param { number } [offset] - offset [offset = 0] Number of bytes to skip before starting to read. Must satisfy 0 <= offset <= buf.length - 4
* @returns { number } Reads an unsigned, big-endian 32-bit integer
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Incorrect parameter types.
* @throws { BusinessError } 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 4. Received value is: [offset]
* @syscap SystemCapability.Utils.Lang
* @since 9
*/
/**
* Reads a 32-bit, big-endian, unsigned integer from this Buffer instance at the specified offset.
*
* @param { number } [offset] - Number of bytes to skip before starting to read data. The default value is 0. The value range is [0, Buffer.length - 4].
* @returns { number } Reads an unsigned, big-endian 32-bit integer
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Incorrect parameter types.
* @throws { BusinessError } 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 4. Received value is: [offset]
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Reads a 32-bit, big-endian, unsigned integer from this Buffer instance at the specified offset.
*
* @param { number } [offset] - Number of bytes to skip before starting to read data. The default value is 0. The value range is [0, Buffer.length - 4].
* @returns { number } Reads an unsigned, big-endian 32-bit integer
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Incorrect parameter types.
* @throws { BusinessError } 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 4. Received value is: [offset]
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'11', '1.2':'20'}
* @arkts 1.1&1.2
*/
readUInt32BE(offset?: number): number;
/**
* Reads an unsigned, little-endian 32-bit integer from buf at the specified offset
*
* @param { number } [offset] - offset [offset = 0] Number of bytes to skip before starting to read. Must satisfy 0 <= offset <= buf.length - 4
* @returns { number } Reads an unsigned, little-endian 32-bit integer
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Incorrect parameter types.
* @throws { BusinessError } 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 4. Received value is: [offset]
* @syscap SystemCapability.Utils.Lang
* @since 9
*/
/**
* Reads a 32-bit, little-endian, unsigned integer from this Buffer instance at the specified offset.
*
* @param { number } [offset] - Number of bytes to skip before starting to read data. The default value is 0. The value range is [0, Buffer.length - 4].
* @returns { number } Reads an unsigned, little-endian 32-bit integer
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Incorrect parameter types.
* @throws { BusinessError } 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 4. Received value is: [offset]
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Reads a 32-bit, little-endian, unsigned integer from this Buffer instance at the specified offset.
*
* @param { number } [offset] - Number of bytes to skip before starting to read data. The default value is 0. The value range is [0, Buffer.length - 4].
* @returns { number } Reads an unsigned, little-endian 32-bit integer
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Incorrect parameter types.
* @throws { BusinessError } 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 4. Received value is: [offset]
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'11', '1.2':'20'}
* @arkts 1.1&1.2
*/
readUInt32LE(offset?: number): number;
/**
* Reads byteLength number of bytes from buf at the specified offset and interprets the result as
* an unsigned big-endian integer supporting up to 48 bits of accuracy.
*
* @param { number } offset - offset offset Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - byteLength
* @param { number } byteLength - byteLength byteLength Number of bytes to read. Must satisfy 0 < byteLength <= 6
* @returns { number }
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @throws { BusinessError } 10200001 - The value of "[param]" is out of range. It must be >= [left range] and <= [right range]. Received value is: [param]
* @syscap SystemCapability.Utils.Lang
* @since 9
*/
/**
* Reads the specified number of bytes from this Buffer instance at the specified offset, and interprets the result as an unsigned,
* big-endian integer that supports up to 48 bits of precision.
*
* @param { number } offset - Number of bytes to skip before starting to read data.
* The default value is 0. The value range is [0, Buffer.length - byteLength].
* @param { number } byteLength - Number of bytes to read. The value range is [1, 6].
* @returns { number }
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @throws { BusinessError } 10200001 - The value of "[param]" is out of range. It must be >= [left range] and <= [right range]. Received value is: [param]
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Reads the specified number of bytes from this Buffer instance at the specified offset, and interprets the result as an unsigned,
* big-endian integer that supports up to 48 bits of precision.
*
* @param { number } offset - Number of bytes to skip before starting to read data.
* The default value is 0. The value range is [0, Buffer.length - byteLength].
* @param { number } byteLength - Number of bytes to read. The value range is [1, 6].
* @returns { number }
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @throws { BusinessError } 10200001 - The value of "[param]" is out of range. It must be >= [left range] and <= [right range]. Received value is: [param]
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'11', '1.2':'20'}
* @arkts 1.1&1.2
*/
readUIntBE(offset: number, byteLength: number): number;
/**
* Reads byteLength number of bytes from buf at the specified offset and interprets the result as an unsigned,
* little-endian integer supporting up to 48 bits of accuracy.
*
* @param { number } offset - offset offset Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - byteLength
* @param { number } byteLength - byteLength byteLength Number of bytes to read. Must satisfy 0 < byteLength <= 6
* @returns { number }
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @throws { BusinessError } 10200001 - The value of "[param]" is out of range. It must be >= [left range] and <= [right range]. Received value is: [param]
* @syscap SystemCapability.Utils.Lang
* @since 9
*/
/**
* Reads the specified number of bytes from this Buffer instance at the specified offset, and interprets the result as an unsigned,
* little-endian integer that supports up to 48 bits of precision.
*
* @param { number } offset - Number of bytes to skip before starting to read data.
* The default value is 0. The value range is [0, Buffer.length - byteLength].
* @param { number } byteLength - Number of bytes to read. The value range is [1, 6].
* @returns { number }
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @throws { BusinessError } 10200001 - The value of "[param]" is out of range. It must be >= [left range] and <= [right range]. Received value is: [param]
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Reads the specified number of bytes from this Buffer instance at the specified offset, and interprets the result as an unsigned,
* little-endian integer that supports up to 48 bits of precision.
*
* @param { number } offset - Number of bytes to skip before starting to read data.
* The default value is 0. The value range is [0, Buffer.length - byteLength].
* @param { number } byteLength - Number of bytes to read. The value range is [1, 6].
* @returns { number }
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @throws { BusinessError } 10200001 - The value of "[param]" is out of range. It must be >= [left range] and <= [right range]. Received value is: [param]
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'11', '1.2':'20'}
* @arkts 1.1&1.2
*/
readUIntLE(offset: number, byteLength: number): number;
/**
* Returns a new Buffer that references the same memory as the original, but offset and cropped by the start and end indices.
*
* @param { number } [start] - start [start = 0] Where the new Buffer will start
* @param { number } [end] - end [end = buf.length] Where the new Buffer will end (not inclusive)
* @returns { Buffer } Returns a new Buffer that references the same memory as the original
* @syscap SystemCapability.Utils.Lang
* @since 9
*/
/**
* Truncates this Buffer instance from the specified position to create a new Buffer instance.
*
* @param { number } [start] - Offset to the start position in this Buffer instance where data is truncated. The default value is 0.
* @param { number } [end] - Offset to the end position in this Buffer instance (not inclusive). The default value is the length of this Buffer instance.
* @returns { Buffer } Returns a new Buffer that references the same memory as the original
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Truncates this Buffer instance from the specified position to create a new Buffer instance.
*
* @param { number } [start] - Offset to the start position in this Buffer instance where data is truncated. The default value is 0.
* @param { number } [end] - Offset to the end position in this Buffer instance (not inclusive). The default value is the length of this Buffer instance.
* @returns { Buffer } Returns a new Buffer that references the same memory as the original
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'11', '1.2':'20'}
* @arkts 1.1&1.2
*/
subarray(start?: number, end?: number): Buffer;
/**
* Interprets buf as an array of unsigned 16-bit integers and swaps the byte order in-place.
*
* @returns { Buffer } A reference to buf
* @throws { BusinessError } 10200009 - The buffer size must be a multiple of 16-bits
* @syscap SystemCapability.Utils.Lang
* @since 9
*/
/**
* Interprets this Buffer instance as an array of unsigned 16-bit integers and swaps the byte order in place.
*
* @returns { Buffer } A reference to buf
* @throws { BusinessError } 10200009 - The buffer size must be a multiple of 16-bits
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Interprets this Buffer instance as an array of unsigned 16-bit integers and swaps the byte order in place.
*
* @returns { Buffer } A reference to buf
* @throws { BusinessError } 10200009 - The buffer size must be a multiple of 16-bits
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'11', '1.2':'20'}
* @arkts 1.1&1.2
*/
swap16(): Buffer;
/**
* Interprets buf as an array of unsigned 32-bit integers and swaps the byte order in-place.
*
* @returns { Buffer } A reference to buf
* @throws { BusinessError } 10200009 - The buffer size must be a multiple of 32-bits
* @syscap SystemCapability.Utils.Lang
* @since 9
*/
/**
* Interprets this Buffer instance as an array of unsigned 32-bit integers and swaps the byte order in place.
*
* @returns { Buffer } A reference to buf
* @throws { BusinessError } 10200009 - The buffer size must be a multiple of 32-bits
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Interprets this Buffer instance as an array of unsigned 32-bit integers and swaps the byte order in place.
*
* @returns { Buffer } A reference to buf
* @throws { BusinessError } 10200009 - The buffer size must be a multiple of 32-bits
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'11', '1.2':'20'}
* @arkts 1.1&1.2
*/
swap32(): Buffer;
/**
* Interprets buf as an array of unsigned 64-bit integers and swaps the byte order in-place.
*
* @returns { Buffer } A reference to buf
* @throws { BusinessError } 10200009 - The buffer size must be a multiple of 64-bits
* @syscap SystemCapability.Utils.Lang
* @since 9
*/
/**
* Interprets this Buffer instance as an array of unsigned 64-bit integers and swaps the byte order in place.
*
* @returns { Buffer } A reference to buf
* @throws { BusinessError } 10200009 - The buffer size must be a multiple of 64-bits
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Interprets this Buffer instance as an array of unsigned 64-bit integers and swaps the byte order in place.
*
* @returns { Buffer } A reference to buf
* @throws { BusinessError } 10200009 - The buffer size must be a multiple of 64-bits
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'11', '1.2':'20'}
* @arkts 1.1&1.2
*/
swap64(): Buffer;
/**
* Returns a JSON representation of buf
*
* @returns { Object } Returns a JSON
* @syscap SystemCapability.Utils.Lang
* @since 9
*/
/**
* Returns a JSON representation of buf
*
* @returns { Object } Returns a JSON
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Converts this Buffer instance into a JSON object.
*
* @returns { Object } Returns a JSON
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since 11
*/
toJSON(): Object;
/**
* Decodes buf to a string according to the specified character encoding in encoding
*
* @param { string } [encoding] - encoding [encoding='utf8'] The character encoding to use
* @param { number } [start] - start [start = 0] The byte offset to start decoding at
* @param { number } [end] - end [end = buf.length] The byte offset to stop decoding at (not inclusive)
* @returns { string }
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Incorrect parameter types.
* @syscap SystemCapability.Utils.Lang
* @since 9
*/
/**
* Decodes buf to a string according to the specified character encoding in encoding
*
* @param { string } [encoding] - encoding [encoding='utf8'] The character encoding to use
* @param { number } [start] - start [start = 0] The byte offset to start decoding at
* @param { number } [end] - end [end = buf.length] The byte offset to stop decoding at (not inclusive)
* @returns { string }
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Incorrect parameter types.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Converts the data at the specified position in this Buffer instance into a string in the specified encoding format.
*
* @param { string } [encoding] - Encoding format (valid only when value is a string). The default value is 'utf8'.
* @param { number } [start] - Offset to the start position of the data to convert. The default value is 0.
* @param { number } [end] - Offset to the end position of the data to convert. The default value is the length of this Buffer instance.
* @returns { string }
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Incorrect parameter types.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since 11
*/
toString(encoding?: string, start?: number, end?: number): string;
/**
* Decodes buf to a string according to the specified character encoding in encoding
*
* @param { BufferEncoding } [encoding] - encoding [encoding='utf8'] The character encoding to use
* @param { number } [start] - start [start = 0] The byte offset to start decoding at
* @param { number } [end] - end [end = buf.length] The byte offset to stop decoding at (not inclusive)
* @returns { string }
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since 20
* @arkts 1.2
*/
toString(encoding?: BufferEncoding, start?: number, end?: number): string;
/**
* Writes string to buf at offset according to the character encoding in encoding
*
* @param { string } str - str str Writes string to buf at offset according to the character encoding in encoding
* @param { number } [offset] - offset [offset = 0] Number of bytes to skip before starting to write string
* @param { number } [length] - length [length = buf.length - offset] Maximum number of bytes to write (written bytes will not exceed buf.length - offset)
* @param { string } [encoding] - encoding [encoding='utf8'] The character encoding of string.
* @returns { number } Number of bytes written.
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @throws { BusinessError } 10200001 - The value of "[offset/length]" is out of range. It must be >= 0 and <= buf.length. Received value is: [offset/length]
* @syscap SystemCapability.Utils.Lang
* @since 9
*/
/**
* Writes a string of the specified length to this Buffer instance at the specified position in the given encoding format.
*
* @param { string } str - String to write.
* @param { number } [offset] - Number of bytes to skip before starting to write data. The default value is 0.
* @param { number } [length] - Maximum number of bytes to write. The default value is Buffer.length minus offset.
* @param { string } [encoding] - Encoding format of the string. The default value is 'utf8'.
* @returns { number } Number of bytes written.
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @throws { BusinessError } 10200001 - The value of "[offset/length]" is out of range. It must be >= 0 and <= buf.length. Received value is: [offset/length]
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Writes a string of the specified length to this Buffer instance at the specified position in the given encoding format.
*
* @param { string } str - String to write.
* @param { number } [offset] - Number of bytes to skip before starting to write data. The default value is 0.
* @param { number } [length] - Maximum number of bytes to write. The default value is Buffer.length minus offset.
* @param { string } [encoding] - Encoding format of the string. The default value is 'utf8'.
* @returns { number } Number of bytes written.
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @throws { BusinessError } 10200001 - The value of "[offset/length]" is out of range. It must be >= 0 and <= buf.length. Received value is: [offset/length]
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'11', '1.2':'20'}
* @arkts 1.1&1.2
*/
write(str: string, offset?: number, length?: number, encoding?: string): number;
/**
* Writes value to buf at the specified offset as big-endian.
*
* @param { bigint } value - value value Number to be written to buf
* @param { number } [offset] - offset [offset = 0] Number of bytes to skip before starting to write. Must satisfy: 0 <= offset <= buf.length - 8
* @returns { number } offset plus the number of bytes written
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types; 3.Parameter verification failed.
* @throws { BusinessError } 10200001 - The value of "[param]" is out of range. It must be >= [left range] and <= [right range]. Received value is: [param]
* @syscap SystemCapability.Utils.Lang
* @since 9
*/
/**
* Writes a 64-bit, big-endian, signed big integer to this Buffer instance at the specified offset.
*
* @param { bigint } value - Data to write.
* @param { number } [offset] - Number of bytes to skip before starting to write data. The default value is 0. The value range is [0, Buffer.length - 8].
* @returns { number } offset plus the number of bytes written
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types;
* 3.Parameter verification failed.
* @throws { BusinessError } 10200001 - The value of "[param]" is out of range. It must be >= [left range] and <= [right range]. Received value is: [param]
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Writes a 64-bit, big-endian, signed big integer to this Buffer instance at the specified offset.
*
* @param { bigint } value - Data to write.
* @param { number } [offset] - Number of bytes to skip before starting to write data. The default value is 0. The value range is [0, Buffer.length - 8].
* @returns { number } offset plus the number of bytes written
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types;
* 3.Parameter verification failed.
* @throws { BusinessError } 10200001 - The value of "[param]" is out of range. It must be >= [left range] and <= [right range]. Received value is: [param]
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'11', '1.2':'20'}
* @arkts 1.1&1.2
*/
writeBigInt64BE(value: bigint, offset?: number): number;
/**
* Writes value to buf at the specified offset as little-endian.
*
* @param { bigint } value - value value Number to be written to buf
* @param { number } [offset] - offset [offset = 0] Number of bytes to skip before starting to write. Must satisfy: 0 <= offset <= buf.length - 8
* @returns { number } offset plus the number of bytes written
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types;
* 3.Parameter verification failed.
* @throws { BusinessError } 10200001 - The value of "[param]" is out of range. It must be >= [left range] and <= [right range]. Received value is: [param]
* @syscap SystemCapability.Utils.Lang
* @since 9
*/
/**
* Writes a 64-bit, little-endian, signed big integer to this Buffer instance at the specified offset.
*
* @param { bigint } value - Data to write.
* @param { number } [offset] - Number of bytes to skip before starting to write data. The default value is 0. The value range is [0, Buffer.length - 8].
* @returns { number } offset plus the number of bytes written
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types;
* 3.Parameter verification failed.
* @throws { BusinessError } 10200001 - The value of "[param]" is out of range. It must be >= [left range] and <= [right range]. Received value is: [param]
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Writes a 64-bit, little-endian, signed big integer to this Buffer instance at the specified offset.
*
* @param { bigint } value - Data to write.
* @param { number } [offset] - Number of bytes to skip before starting to write data. The default value is 0. The value range is [0, Buffer.length - 8].
* @returns { number } offset plus the number of bytes written
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types;
* 3.Parameter verification failed.
* @throws { BusinessError } 10200001 - The value of "[param]" is out of range. It must be >= [left range] and <= [right range]. Received value is: [param]
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'11', '1.2':'20'}
* @arkts 1.1&1.2
*/
writeBigInt64LE(value: bigint, offset?: number): number;
/**
* Writes value to buf at the specified offset as big-endian.
*
* @param { bigint } value - value value Number to be written to buf
* @param { number } [offset] - offset [offset = 0] Number of bytes to skip before starting to write. Must satisfy: 0 <= offset <= buf.length - 8
* @returns { number } offset plus the number of bytes written
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types;
* 3.Parameter verification failed.
* @throws { BusinessError } 10200001 - The value of "[param]" is out of range. It must be >= [left range] and <= [right range]. Received value is: [param]
* @syscap SystemCapability.Utils.Lang
* @since 9
*/
/**
* Writes a 64-bit, big-endian, unsigned big integer to this Buffer instance at the specified offset.
*
* @param { bigint } value - Data to write.
* @param { number } [offset] - Number of bytes to skip before starting to write data. The default value is 0. The value range is [0, Buffer.length - 8].
* @returns { number } offset plus the number of bytes written
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types;
* 3.Parameter verification failed.
* @throws { BusinessError } 10200001 - The value of "[param]" is out of range. It must be >= [left range] and <= [right range]. Received value is: [param]
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Writes a 64-bit, big-endian, unsigned big integer to this Buffer instance at the specified offset.
*
* @param { bigint } value - Data to write.
* @param { number } [offset] - Number of bytes to skip before starting to write data. The default value is 0. The value range is [0, Buffer.length - 8].
* @returns { number } offset plus the number of bytes written
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types;
* 3.Parameter verification failed.
* @throws { BusinessError } 10200001 - The value of "[param]" is out of range. It must be >= [left range] and <= [right range]. Received value is: [param]
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'11', '1.2':'20'}
* @arkts 1.1&1.2
*/
writeBigUInt64BE(value: bigint, offset?: number): number;
/**
* Writes value to buf at the specified offset as little-endian.
*
* @param { bigint } value - value value Number to be written to buf
* @param { number } [offset] - offset [offset = 0] Number of bytes to skip before starting to write. Must satisfy: 0 <= offset <= buf.length - 8
* @returns { number } offset plus the number of bytes written
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types;
* 3.Parameter verification failed.
* @throws { BusinessError } 10200001 - The value of "[param]" is out of range. It must be >= [left range] and <= [right range]. Received value is: [param]
* @syscap SystemCapability.Utils.Lang
* @since 9
*/
/**
* Writes a 64-bit, little-endian, unsigned big integer to this Buffer instance at the specified offset.
*
* @param { bigint } value - Data to write.
* @param { number } [offset] - Number of bytes to skip before starting to write data. The default value is 0. The value range is [0, Buffer.length - 8].
* @returns { number } offset plus the number of bytes written
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types;
* 3.Parameter verification failed.
* @throws { BusinessError } 10200001 - The value of "[param]" is out of range. It must be >= [left range] and <= [right range]. Received value is: [param]
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Writes a 64-bit, little-endian, unsigned big integer to this Buffer instance at the specified offset.
*
* @param { bigint } value - Data to write.
* @param { number } [offset] - Number of bytes to skip before starting to write data. The default value is 0. The value range is [0, Buffer.length - 8].
* @returns { number } offset plus the number of bytes written
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types;
* 3.Parameter verification failed.
* @throws { BusinessError } 10200001 - The value of "[param]" is out of range. It must be >= [left range] and <= [right range]. Received value is: [param]
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'11', '1.2':'20'}
* @arkts 1.1&1.2
*/
writeBigUInt64LE(value: bigint, offset?: number): number;
/**
* Writes value to buf at the specified offset as big-endian.
*
* @param { number } value - value value Number to be written to buf
* @param { number } [offset] - offset [offset = 0] Number of bytes to skip before starting to write. Must satisfy: 0 <= offset <= buf.length - 8
* @returns { number } offset plus the number of bytes written
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @throws { BusinessError } 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 8. Received value is: [offset]
* @syscap SystemCapability.Utils.Lang
* @since 9
*/
/**
* Writes a 64-bit, big-endian, double-precision floating-point number to this Buffer instance at the specified offset.
*
* @param { number } value - Data to write.
* @param { number } [offset] - Number of bytes to skip before starting to write data. The default value is 0. The value range is [0, Buffer.length - 8].
* @returns { number } offset plus the number of bytes written
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @throws { BusinessError } 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 8. Received value is: [offset]
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Writes a 64-bit, big-endian, double-precision floating-point number to this Buffer instance at the specified offset.
*
* @param { number } value - Data to write.
* @param { number } [offset] - Number of bytes to skip before starting to write data. The default value is 0. The value range is [0, Buffer.length - 8].
* @returns { number } offset plus the number of bytes written
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @throws { BusinessError } 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 8. Received value is: [offset]
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'11', '1.2':'20'}
* @arkts 1.1&1.2
*/
writeDoubleBE(value: number, offset?: number): number;
/**
* Writes value to buf at the specified offset as little-endian.
*
* @param { number } value - value value Number to be written to buf
* @param { number } [offset] - offset [offset = 0] Number of bytes to skip before starting to write. Must satisfy: 0 <= offset <= buf.length - 8
* @returns { number } offset plus the number of bytes written
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @throws { BusinessError } 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 8. Received value is: [offset]
* @syscap SystemCapability.Utils.Lang
* @since 9
*/
/**
* Writes a 64-bit, little-endian, double-precision floating-point number to this Buffer instance at the specified offset.
*
* @param { number } value - Data to write.
* @param { number } [offset] - Number of bytes to skip before starting to write data. The default value is 0. The value range is [0, Buffer.length - 8].
* @returns { number } offset plus the number of bytes written
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @throws { BusinessError } 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 8. Received value is: [offset]
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Writes a 64-bit, little-endian, double-precision floating-point number to this Buffer instance at the specified offset.
*
* @param { number } value - Data to write.
* @param { number } [offset] - Number of bytes to skip before starting to write data. The default value is 0. The value range is [0, Buffer.length - 8].
* @returns { number } offset plus the number of bytes written
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @throws { BusinessError } 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 8. Received value is: [offset]
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'11', '1.2':'20'}
* @arkts 1.1&1.2
*/
writeDoubleLE(value: number, offset?: number): number;
/**
* Writes value to buf at the specified offset as big-endian.
*
* @param { number } value - value value Number to be written to buf
* @param { number } [offset] - offset [offset = 0] Number of bytes to skip before starting to write. Must satisfy: 0 <= offset <= buf.length - 4
* @returns { number } offset plus the number of bytes written
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @throws { BusinessError } 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 4. Received value is: [offset]
* @syscap SystemCapability.Utils.Lang
* @since 9
*/
/**
* Writes a 32-bit, big-endian, single-precision floating-point number to this Buffer instance at the specified offset.
*
* @param { number } value - Data to write.
* @param { number } [offset] - Number of bytes to skip before starting to write data. The default value is 0. The value range is [0, Buffer.length - 4].
* @returns { number } offset plus the number of bytes written
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @throws { BusinessError } 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 4. Received value is: [offset]
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Writes a 32-bit, big-endian, single-precision floating-point number to this Buffer instance at the specified offset.
*
* @param { number } value - Data to write.
* @param { number } [offset] - Number of bytes to skip before starting to write data. The default value is 0. The value range is [0, Buffer.length - 4].
* @returns { number } offset plus the number of bytes written
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @throws { BusinessError } 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 4. Received value is: [offset]
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'11', '1.2':'20'}
* @arkts 1.1&1.2
*/
writeFloatBE(value: number, offset?: number): number;
/**
* Writes value to buf at the specified offset as little-endian.
*
* @param { number } value - value value Number to be written to buf
* @param { number } [offset] - offset [offset = 0] Number of bytes to skip before starting to write. Must satisfy: 0 <= offset <= buf.length - 4
* @returns { number } offset plus the number of bytes written
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @throws { BusinessError } 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 4. Received value is: [offset]
* @syscap SystemCapability.Utils.Lang
* @since 9
*/
/**
* Writes a 32-bit, little-endian, single-precision floating-point number to this Buffer instance at the specified offset.
*
* @param { number } value - Data to write.
* @param { number } [offset] - Number of bytes to skip before starting to write data. The default value is 0. The value range is [0, Buffer.length - 4].
* @returns { number } offset plus the number of bytes written
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @throws { BusinessError } 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 4. Received value is: [offset]
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Writes a 32-bit, little-endian, single-precision floating-point number to this Buffer instance at the specified offset.
*
* @param { number } value - Data to write.
* @param { number } [offset] - Number of bytes to skip before starting to write data. The default value is 0. The value range is [0, Buffer.length - 4].
* @returns { number } offset plus the number of bytes written
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @throws { BusinessError } 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 4. Received value is: [offset]
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'11', '1.2':'20'}
* @arkts 1.1&1.2
*/
writeFloatLE(value: number, offset?: number): number;
/**
* Writes value to buf at the specified offset. value must be a valid signed 8-bit integer.
*
* @param { number } value - value value Number to be written to buf
* @param { number } [offset] - offset [offset = 0] Number of bytes to skip before starting to write. Must satisfy: 0 <= offset <= buf.length - 1
* @returns { number } offset plus the number of bytes written
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types;
* 3.Parameter verification failed.
* @throws { BusinessError } 10200001 - The value of "[param]" is out of range. It must be >= [left range] and <= [right range]. Received value is: [param]
* @syscap SystemCapability.Utils.Lang
* @since 9
*/
/**
* Writes an 8-bit signed integer to this Buffer instance at the specified offset.
*
* @param { number } value - Data to write.
* @param { number } [offset] - Number of bytes to skip before starting to write data. The default value is 0. The value range is [0, Buffer.length - 1].
* @returns { number } offset plus the number of bytes written
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types;
* 3.Parameter verification failed.
* @throws { BusinessError } 10200001 - The value of "[param]" is out of range. It must be >= [left range] and <= [right range]. Received value is: [param]
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Writes an 8-bit signed integer to this Buffer instance at the specified offset.
*
* @param { number } value - Data to write.
* @param { number } [offset] - Number of bytes to skip before starting to write data. The default value is 0. The value range is [0, Buffer.length - 1].
* @returns { number } offset plus the number of bytes written
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types;
* 3.Parameter verification failed.
* @throws { BusinessError } 10200001 - The value of "[param]" is out of range. It must be >= [left range] and <= [right range]. Received value is: [param]
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'11', '1.2':'20'}
* @arkts 1.1&1.2
*/
writeInt8(value: number, offset?: number): number;
/**
* Writes value to buf at the specified offset as big-endian. The value must be a valid signed 16-bit integer
*
* @param { number } value - value value Number to be written to buf
* @param { number } [offset] - offset [offset = 0] Number of bytes to skip before starting to write. Must satisfy: 0 <= offset <= buf.length - 2
* @returns { number } offset plus the number of bytes written
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types;
* 3.Parameter verification failed.
* @throws { BusinessError } 10200001 - The value of "[param]" is out of range. It must be >= [left range] and <= [right range]. Received value is: [param]
* @syscap SystemCapability.Utils.Lang
* @since 9
*/
/**
* Writes a 16-bit, big-endian, signed integer to this Buffer instance at the specified offset.
*
* @param { number } value - Data to write.
* @param { number } [offset] - Number of bytes to skip before starting to write data. The default value is 0. The value range is [0, Buffer.length - 2].
* @returns { number } offset plus the number of bytes written
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types;
* 3.Parameter verification failed.
* @throws { BusinessError } 10200001 - The value of "[param]" is out of range. It must be >= [left range] and <= [right range]. Received value is: [param]
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Writes a 16-bit, big-endian, signed integer to this Buffer instance at the specified offset.
*
* @param { number } value - Data to write.
* @param { number } [offset] - Number of bytes to skip before starting to write data. The default value is 0. The value range is [0, Buffer.length - 2].
* @returns { number } offset plus the number of bytes written
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types;
* 3.Parameter verification failed.
* @throws { BusinessError } 10200001 - The value of "[param]" is out of range. It must be >= [left range] and <= [right range]. Received value is: [param]
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'11', '1.2':'20'}
* @arkts 1.1&1.2
*/
writeInt16BE(value: number, offset?: number): number;
/**
* Writes value to buf at the specified offset as little-endian. The value must be a valid signed 16-bit integer
*
* @param { number } value - value value Number to be written to buf
* @param { number } [offset] - offset [offset = 0] Number of bytes to skip before starting to write. Must satisfy: 0 <= offset <= buf.length - 2
* @returns { number } offset plus the number of bytes written
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types;
* 3.Parameter verification failed.
* @throws { BusinessError } 10200001 - The value of "[param]" is out of range. It must be >= [left range] and <= [right range]. Received value is: [param]
* @syscap SystemCapability.Utils.Lang
* @since 9
*/
/**
* Writes a 16-bit, little-endian, signed integer to this Buffer instance at the specified offset.
*
* @param { number } value - Data to write.
* @param { number } [offset] - Number of bytes to skip before starting to write data. The default value is 0. The value range is [0, Buffer.length - 2].
* @returns { number } offset plus the number of bytes written
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types;
* 3.Parameter verification failed.
* @throws { BusinessError } 10200001 - The value of "[param]" is out of range. It must be >= [left range] and <= [right range]. Received value is: [param]
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Writes a 16-bit, little-endian, signed integer to this Buffer instance at the specified offset.
*
* @param { number } value - Data to write.
* @param { number } [offset] - Number of bytes to skip before starting to write data. The default value is 0. The value range is [0, Buffer.length - 2].
* @returns { number } offset plus the number of bytes written
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types;
* 3.Parameter verification failed.
* @throws { BusinessError } 10200001 - The value of "[param]" is out of range. It must be >= [left range] and <= [right range]. Received value is: [param]
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'11', '1.2':'20'}
* @arkts 1.1&1.2
*/
writeInt16LE(value: number, offset?: number): number;
/**
* Writes value to buf at the specified offset as big-endian. The value must be a valid signed 32-bit integer.
*
* @param { number } value - value value Number to be written to buf
* @param { number } [offset] - offset [offset = 0] Number of bytes to skip before starting to write. Must satisfy: 0 <= offset <= buf.length - 4
* @returns { number } offset plus the number of bytes written
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types;
* 3.Parameter verification failed.
* @throws { BusinessError } 10200001 - The value of "[param]" is out of range. It must be >= [left range] and <= [right range]. Received value is: [param]
* @syscap SystemCapability.Utils.Lang
* @since 9
*/
/**
* Writes a 32-bit, big-endian, signed integer to this Buffer instance at the specified offset.
*
* @param { number } value - Data to write.
* @param { number } [offset] - Number of bytes to skip before starting to write data. The default value is 0. The value range is [0, Buffer.length - 4].
* @returns { number } offset plus the number of bytes written
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types;
* 3.Parameter verification failed.
* @throws { BusinessError } 10200001 - The value of "[param]" is out of range. It must be >= [left range] and <= [right range]. Received value is: [param]
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Writes a 32-bit, big-endian, signed integer to this Buffer instance at the specified offset.
*
* @param { number } value - Data to write.
* @param { number } [offset] - Number of bytes to skip before starting to write data. The default value is 0. The value range is [0, Buffer.length - 4].
* @returns { number } offset plus the number of bytes written
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types;
* 3.Parameter verification failed.
* @throws { BusinessError } 10200001 - The value of "[param]" is out of range. It must be >= [left range] and <= [right range]. Received value is: [param]
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'11', '1.2':'20'}
* @arkts 1.1&1.2
*/
writeInt32BE(value: number, offset?: number): number;
/**
* Writes value to buf at the specified offset as little-endian. The value must be a valid signed 32-bit integer.
*
* @param { number } value - value value Number to be written to buf
* @param { number } [offset] - offset [offset = 0] Number of bytes to skip before starting to write. Must satisfy: 0 <= offset <= buf.length - 4
* @returns { number } offset plus the number of bytes written
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types;
* 3.Parameter verification failed.
* @throws { BusinessError } 10200001 - The value of "[param]" is out of range. It must be >= [left range] and <= [right range]. Received value is: [param]
* @syscap SystemCapability.Utils.Lang
* @since 9
*/
/**
* Writes a 32-bit, little-endian, signed integer to this Buffer instance at the specified offset.
*
* @param { number } value - Data to write.
* @param { number } [offset] - Number of bytes to skip before starting to write data. The default value is 0. The value range is [0, Buffer.length - 4].
* @returns { number } offset plus the number of bytes written
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types;
* 3.Parameter verification failed.
* @throws { BusinessError } 10200001 - The value of "[param]" is out of range. It must be >= [left range] and <= [right range]. Received value is: [param]
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Writes a 32-bit, little-endian, signed integer to this Buffer instance at the specified offset.
*
* @param { number } value - Data to write.
* @param { number } [offset] - Number of bytes to skip before starting to write data. The default value is 0. The value range is [0, Buffer.length - 4].
* @returns { number } offset plus the number of bytes written
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types;
* 3.Parameter verification failed.
* @throws { BusinessError } 10200001 - The value of "[param]" is out of range. It must be >= [left range] and <= [right range]. Received value is: [param]
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'11', '1.2':'20'}
* @arkts 1.1&1.2
*/
writeInt32LE(value: number, offset?: number): number;
/**
* Writes byteLength bytes of value to buf at the specified offset as big-endian
*
* @param { number } value - value value Number to be written to buf
* @param { number } offset - offset offset Number of bytes to skip before starting to write. Must satisfy 0 <= offset <= buf.length - byteLength
* @param { number } byteLength - byteLength byteLength Number of bytes to write. Must satisfy 0 < byteLength <= 6
* @returns { number } offset plus the number of bytes written
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @throws { BusinessError } 10200001 - The value of "[param]" is out of range. It must be >= [left range] and <= [right range]. Received value is: [param]
* @syscap SystemCapability.Utils.Lang
* @since 9
*/
/**
* Writes a big-endian signed value of the specified length to this Buffer instance at the specified offset.
*
* @param { number } value - Data to write.
* @param { number } offset - Number of bytes to skip before starting to write data.
* The default value is 0. The value range is [0, Buffer.length - byteLength].
* @param { number } byteLength - Number of bytes to write.
* @returns { number } offset plus the number of bytes written
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @throws { BusinessError } 10200001 - The value of "[param]" is out of range. It must be >= [left range] and <= [right range]. Received value is: [param]
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Writes a big-endian signed value of the specified length to this Buffer instance at the specified offset.
*
* @param { number } value - Data to write.
* @param { number } offset - Number of bytes to skip before starting to write data.
* The default value is 0. The value range is [0, Buffer.length - byteLength].
* @param { number } byteLength - Number of bytes to write.
* @returns { number } offset plus the number of bytes written
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @throws { BusinessError } 10200001 - The value of "[param]" is out of range. It must be >= [left range] and <= [right range]. Received value is: [param]
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'11', '1.2':'20'}
* @arkts 1.1&1.2
*/
writeIntBE(value: number, offset: number, byteLength: number): number;
/**
* Writes byteLength bytes of value to buf at the specified offset as little-endian
*
* @param { number } value - value value Number to be written to buf
* @param { number } offset - offset offset Number of bytes to skip before starting to write. Must satisfy 0 <= offset <= buf.length - byteLength
* @param { number } byteLength - byteLength byteLength Number of bytes to write. Must satisfy 0 < byteLength <= 6
* @returns { number } offset plus the number of bytes written
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @throws { BusinessError } 10200001 - The value of "[param]" is out of range. It must be >= [left range] and <= [right range]. Received value is: [param]
* @syscap SystemCapability.Utils.Lang
* @since 9
*/
/**
* Writes a little-endian signed value of the specified length to this Buffer instance at the specified offset.
*
* @param { number } value - Data to write.
* @param { number } offset - Number of bytes to skip before starting to write data. The default value is 0.
* The value range is [0, Buffer.length - byteLength].
* @param { number } byteLength - Number of bytes to write.
* @returns { number } offset plus the number of bytes written
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @throws { BusinessError } 10200001 - The value of "[param]" is out of range. It must be >= [left range] and <= [right range]. Received value is: [param]
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Writes a little-endian signed value of the specified length to this Buffer instance at the specified offset.
*
* @param { number } value - Data to write.
* @param { number } offset - Number of bytes to skip before starting to write data.
* The default value is 0. The value range is [0, Buffer.length - byteLength].
* @param { number } byteLength - Number of bytes to write.
* @returns { number } offset plus the number of bytes written
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @throws { BusinessError } 10200001 - The value of "[param]" is out of range. It must be >= [left range] and <= [right range]. Received value is: [param]
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'11', '1.2':'20'}
* @arkts 1.1&1.2
*/
writeIntLE(value: number, offset: number, byteLength: number): number;
/**
* Writes value to buf at the specified offset. value must be a valid unsigned 8-bit integer
*
* @param { number } value - value value Number to be written to buf
* @param { number } [offset] - offset [offset = 0] Number of bytes to skip before starting to write. Must satisfy 0 <= offset <= buf.length - 1
* @returns { number } offset plus the number of bytes written
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types;
* 3.Parameter verification failed.
* @throws { BusinessError } 10200001 - The value of "[param]" is out of range. It must be >= [left range] and <= [right range]. Received value is: [param]
* @syscap SystemCapability.Utils.Lang
* @since 9
*/
/**
* Writes an 8-bit unsigned integer to this Buffer instance at the specified offset.
*
* @param { number } value - Data to write.
* @param { number } [offset] - Number of bytes to skip before starting to write data. The default value is 0. The value range is [0, Buffer.length - 1].
* @returns { number } offset plus the number of bytes written
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types;
* 3.Parameter verification failed.
* @throws { BusinessError } 10200001 - The value of "[param]" is out of range. It must be >= [left range] and <= [right range]. Received value is: [param]
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Writes an 8-bit unsigned integer to this Buffer instance at the specified offset.
*
* @param { number } value - Data to write.
* @param { number } [offset] - Number of bytes to skip before starting to write data. The default value is 0. The value range is [0, Buffer.length - 1].
* @returns { number } offset plus the number of bytes written
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types;
* 3.Parameter verification failed.
* @throws { BusinessError } 10200001 - The value of "[param]" is out of range. It must be >= [left range] and <= [right range]. Received value is: [param]
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'11', '1.2':'20'}
* @arkts 1.1&1.2
*/
writeUInt8(value: number, offset?: number): number;
/**
* Writes value to buf at the specified offset as big-endian. The value must be a valid unsigned 16-bit integer.
*
* @param { number } value - value value Number to be written to buf
* @param { number } [offset] - offset [offset = 0] Number of bytes to skip before starting to write. Must satisfy 0 <= offset <= buf.length - 2
* @returns { number } offset plus the number of bytes written
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types;
* 3.Parameter verification failed.
* @throws { BusinessError } 10200001 - The value of "[param]" is out of range. It must be >= [left range] and <= [right range]. Received value is: [param]
* @syscap SystemCapability.Utils.Lang
* @since 9
*/
/**
* Writes a 16-bit, big-endian, unsigned integer to this Buffer instance at the specified offset.
*
* @param { number } value - Data to write.
* @param { number } [offset] - Number of bytes to skip before starting to write data. The default value is 0. The value range is [0, Buffer.length - 2].
* @returns { number } offset plus the number of bytes written
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types;
* 3.Parameter verification failed.
* @throws { BusinessError } 10200001 - The value of "[param]" is out of range. It must be >= [left range] and <= [right range]. Received value is: [param]
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Writes a 16-bit, big-endian, unsigned integer to this Buffer instance at the specified offset.
*
* @param { number } value - Data to write.
* @param { number } [offset] - Number of bytes to skip before starting to write data. The default value is 0. The value range is [0, Buffer.length - 2].
* @returns { number } offset plus the number of bytes written
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types;
* 3.Parameter verification failed.
* @throws { BusinessError } 10200001 - The value of "[param]" is out of range. It must be >= [left range] and <= [right range]. Received value is: [param]
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'11', '1.2':'20'}
* @arkts 1.1&1.2
*/
writeUInt16BE(value: number, offset?: number): number;
/**
* Writes value to buf at the specified offset as little-endian. The value must be a valid unsigned 16-bit integer.
*
* @param { number } value - value value Number to be written to buf
* @param { number } [offset] - offset [offset = 0] Number of bytes to skip before starting to write. Must satisfy 0 <= offset <= buf.length - 2
* @returns { number } offset plus the number of bytes written
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types;
* 3.Parameter verification failed.
* @throws { BusinessError } 10200001 - The value of "[param]" is out of range. It must be >= [left range] and <= [right range]. Received value is: [param]
* @syscap SystemCapability.Utils.Lang
* @since 9
*/
/**
* Writes a 16-bit, little-endian, unsigned integer to this Buffer instance at the specified offset.
*
* @param { number } value - Data to write.
* @param { number } [offset] - Number of bytes to skip before starting to write data. The default value is 0. The value range is [0, Buffer.length - 2].
* @returns { number } offset plus the number of bytes written
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types;
* 3.Parameter verification failed.
* @throws { BusinessError } 10200001 - The value of "[param]" is out of range. It must be >= [left range] and <= [right range]. Received value is: [param]
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Writes a 16-bit, little-endian, unsigned integer to this Buffer instance at the specified offset.
*
* @param { number } value - Data to write.
* @param { number } [offset] - Number of bytes to skip before starting to write data. The default value is 0. The value range is [0, Buffer.length - 2].
* @returns { number } offset plus the number of bytes written
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types;
* 3.Parameter verification failed.
* @throws { BusinessError } 10200001 - The value of "[param]" is out of range. It must be >= [left range] and <= [right range]. Received value is: [param]
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'11', '1.2':'20'}
* @arkts 1.1&1.2
*/
writeUInt16LE(value: number, offset?: number): number;
/**
* Writes value to buf at the specified offset as big-endian. The value must be a valid unsigned 32-bit integer.
*
* @param { number } value - value value Number to be written to buf
* @param { number } [offset] - offset [offset = 0] Number of bytes to skip before starting to write. Must satisfy 0 <= offset <= buf.length - 4
* @returns { number } offset plus the number of bytes written
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types;
* 3.Parameter verification failed.
* @throws { BusinessError } 10200001 - The value of "[param]" is out of range. It must be >= [left range] and <= [right range]. Received value is: [param]
* @syscap SystemCapability.Utils.Lang
* @since 9
*/
/**
* Writes a 32-bit, big-endian, unsigned integer to this Buffer instance at the specified offset.
*
* @param { number } value - Data to write.
* @param { number } [offset] - Number of bytes to skip before starting to write data. The default value is 0. The value range is [0, Buffer.length - 4].
* @returns { number } offset plus the number of bytes written
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types;
* 3.Parameter verification failed.
* @throws { BusinessError } 10200001 - The value of "[param]" is out of range. It must be >= [left range] and <= [right range]. Received value is: [param]
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Writes a 32-bit, big-endian, unsigned integer to this Buffer instance at the specified offset.
*
* @param { number } value - Data to write.
* @param { number } [offset] - Number of bytes to skip before starting to write data. The default value is 0. The value range is [0, Buffer.length - 4].
* @returns { number } offset plus the number of bytes written
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types;
* 3.Parameter verification failed.
* @throws { BusinessError } 10200001 - The value of "[param]" is out of range. It must be >= [left range] and <= [right range]. Received value is: [param]
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'11', '1.2':'20'}
* @arkts 1.1&1.2
*/
writeUInt32BE(value: number, offset?: number): number;
/**
* Writes value to buf at the specified offset as little-endian. The value must be a valid unsigned 32-bit integer.
*
* @param { number } value - value value Number to be written to buf
* @param { number } [offset] - offset [offset = 0] Number of bytes to skip before starting to write. Must satisfy 0 <= offset <= buf.length - 4
* @returns { number } offset plus the number of bytes written
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types;
* 3.Parameter verification failed.
* @throws { BusinessError } 10200001 - The value of "[param]" is out of range. It must be >= [left range] and <= [right range]. Received value is: [param]
* @syscap SystemCapability.Utils.Lang
* @since 9
*/
/**
* Writes a 32-bit, little-endian, unsigned integer to this Buffer instance at the specified offset.
*
* @param { number } value - Data to write.
* @param { number } [offset] - Number of bytes to skip before starting to write data. The default value is 0. The value range is [0, Buffer.length - 4].
* @returns { number } offset plus the number of bytes written
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types;
* 3.Parameter verification failed.
* @throws { BusinessError } 10200001 - The value of "[param]" is out of range. It must be >= [left range] and <= [right range]. Received value is: [param]
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Writes a 32-bit, little-endian, unsigned integer to this Buffer instance at the specified offset.
*
* @param { number } value - Data to write.
* @param { number } [offset] - Number of bytes to skip before starting to write data. The default value is 0. The value range is [0, Buffer.length - 4].
* @returns { number } offset plus the number of bytes written
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types;
* 3.Parameter verification failed.
* @throws { BusinessError } 10200001 - The value of "[param]" is out of range. It must be >= [left range] and <= [right range]. Received value is: [param]
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'11', '1.2':'20'}
* @arkts 1.1&1.2
*/
writeUInt32LE(value: number, offset?: number): number;
/**
* Writes byteLength bytes of value to buf at the specified offset as big-endian
*
* @param { number } value - value value Number to be written to buf
* @param { number } offset - offset offset Number of bytes to skip before starting to write. Must satisfy 0 <= offset <= buf.length - byteLength
* @param { number } byteLength - byteLength byteLength Number of bytes to write. Must satisfy 0 < byteLength <= 6
* @returns { number } offset plus the number of bytes written
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @throws { BusinessError } 10200001 - The value of "[param]" is out of range. It must be >= [left range] and <= [right range]. Received value is: [param]
* @syscap SystemCapability.Utils.Lang
* @since 9
*/
/**
* Writes an unsigned big-endian value of the specified length to this Buffer instance at the specified offset.
*
* @param { number } value - Data to write.
* @param { number } offset - Number of bytes to skip before starting to write data.
* The default value is 0. The value range is [0, Buffer.length - byteLength].
* @param { number } byteLength - Number of bytes to write.
* @returns { number } offset plus the number of bytes written
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @throws { BusinessError } 10200001 - The value of "[param]" is out of range. It must be >= [left range] and <= [right range]. Received value is: [param]
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Writes an unsigned big-endian value of the specified length to this Buffer instance at the specified offset.
*
* @param { number } value - Data to write.
* @param { number } offset - Number of bytes to skip before starting to write data.
* The default value is 0. The value range is [0, Buffer.length - byteLength].
* @param { number } byteLength - Number of bytes to write.
* @returns { number } offset plus the number of bytes written
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @throws { BusinessError } 10200001 - The value of "[param]" is out of range. It must be >= [left range] and <= [right range]. Received value is: [param]
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'11', '1.2':'20'}
* @arkts 1.1&1.2
*/
writeUIntBE(value: number, offset: number, byteLength: number): number;
/**
* Writes byteLength bytes of value to buf at the specified offset as little-endian
*
* @param { number } value - value value Number to be written to buf
* @param { number } offset - offset offset Number of bytes to skip before starting to write. Must satisfy 0 <= offset <= buf.length - byteLength
* @param { number } byteLength - byteLength byteLength Number of bytes to write. Must satisfy 0 < byteLength <= 6
* @returns { number } offset plus the number of bytes written
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @throws { BusinessError } 10200001 - The value of "[param]" is out of range. It must be >= [left range] and <= [right range]. Received value is: [param]
* @syscap SystemCapability.Utils.Lang
* @since 9
*/
/**
* Writes an unsigned little-endian value of the specified length to this Buffer instance at the specified offset.
*
* @param { number } value - Data to write.
* @param { number } offset - Number of bytes to skip before starting to write data.
* The default value is 0. The value range is [0, Buffer.length - byteLength].
* @param { number } byteLength - Number of bytes to write.
* @returns { number } offset plus the number of bytes written
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @throws { BusinessError } 10200001 - The value of "[param]" is out of range. It must be >= [left range] and <= [right range]. Received value is: [param]
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Writes an unsigned little-endian value of the specified length to this Buffer instance at the specified offset.
*
* @param { number } value - Data to write.
* @param { number } offset - Number of bytes to skip before starting to write data.
* The default value is 0. The value range is [0, Buffer.length - byteLength].
* @param { number } byteLength - Number of bytes to write.
* @returns { number } offset plus the number of bytes written
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @throws { BusinessError } 10200001 - The value of "[param]" is out of range. It must be >= [left range] and <= [right range]. Received value is: [param]
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'11', '1.2':'20'}
* @arkts 1.1&1.2
*/
writeUIntLE(value: number, offset: number, byteLength: number): number;
/**
* Returns the byte at the specified index.
*
* @param { number } index - byte index to read
* @returns { number | undefined } Returns the byte value at `index`
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since 20
* @arkts 1.2
*/
$_get(index: number): number | undefined;
/**
* Sets the byte at the specified index.
*
* @param { number } index – byte index to write
* @param { number } value – byte value (0–255)
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since 20
* @arkts 1.2
*/
$_set(index: number, value: number): void;
}
/**
* Defines the Blob related options parameters.
*
* @interface BlobOptions
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since 20
* @arkts 1.2
*/
interface BlobOptions {
/**
* Blob content type. The default parameter is' '.
* @type { ?string }
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since 20
* @arkts 1.2
*/
type?: string;
/**
* How to output a string ending with '\ n' as' transparent or native . The default value is transparent.
* @type { ?string }
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since 20
* @arkts 1.2
*/
endings?: string;
}
/**
* Process data as blob type
*
* @syscap SystemCapability.Utils.Lang
* @since 9
*/
/**
* Process data as blob type
*
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Process data as blob type
*
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'11', '1.2':'20'}
* @arkts 1.1&1.2
*/
class Blob {
/**
* Creates a new Blob object containing a concatenation of the given sources.
*
* @param { string[] | ArrayBuffer[] | TypedArray[] | DataView[] | Blob[] } sources - sources sources An array of string, <ArrayBuffer>,
* <TypedArray>, <DataView>, or <Blob> objects, or any mix of such objects, that will be stored within the Blob
* @param { Object } [options] - options options {endings: string, type: string}
* endings: One of either 'transparent' or 'native'.
* type: The Blob content-type
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @syscap SystemCapability.Utils.Lang
* @since 9
*/
/**
* Creates a new Blob object containing a concatenation of the given sources.
*
* @param { string[] | ArrayBuffer[] | TypedArray[] | DataView[] | Blob[] } sources - sources sources An array of string, <ArrayBuffer>,
* <TypedArray>, <DataView>, or <Blob> objects, or any mix of such objects, that will be stored within the Blob
* @param { Object } [options] - options options {endings: string, type: string}
* endings: One of either 'transparent' or 'native'.
* type: The Blob content-type
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Creates a new Blob object containing a concatenation of the given sources.
*
* @param { string[] | ArrayBuffer[] | TypedArray[] | DataView[] | Blob[] } sources - sources sources An array of string, <ArrayBuffer>,
* <TypedArray>, <DataView>, or <Blob> objects, or any mix of such objects, that will be stored within the Blob
* @param { Object } [options] - options options {endings: string, type: string}
* endings: One of either 'transparent' or 'native'.
* type: The Blob content-type
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since 11
*/
constructor(sources: string[] | ArrayBuffer[] | TypedArray[] | DataView[] | Blob[], options?: Object);
/**
* Creates a new Blob object containing a concatenation of the given sources.
*
* @param { Array<TypedArray> | Array<string> | Array<ArrayBuffer> | Array<DataView> | Array<Blob> } sources - sources sources An array of string, <ArrayBuffer>,
* <TypedArray>, <DataView>, or <Blob> objects, or any mix of such objects, that will be stored within the Blob
* @param { BlobOptions } [options] - options options {endings: string, type: string}
* endings: One of either 'transparent' or 'native'.
* type: The Blob content-type
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since 20
* @arkts 1.2
*/
constructor(sources: Array<TypedArray> | Array<string> | Array<ArrayBuffer> | Array<DataView> | Array<Blob>, options?: BlobOptions);
/**
* The total size of the Blob in bytes
*
* @type { number }
* @syscap SystemCapability.Utils.Lang
* @since 9
*/
/**
* Total size of the Blob instance, in bytes.
*
* @type { number }
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Total size of the Blob instance, in bytes.
*
* @type { number }
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'11', '1.2':'20'}
* @arkts 1.1&1.2
*/
size: number;
/**
* The content-type of the Blob
*
* @type { string }
* @syscap SystemCapability.Utils.Lang
* @since 9
*/
/**
* Type of the data in the Blob instance.
*
* @type { string }
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Type of the data in the Blob instance.
*
* @type { string }
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'11', '1.2':'20'}
* @arkts 1.1&1.2
*/
type: string;
/**
* Returns a promise that fulfills with an <ArrayBuffer> containing a copy of the Blob data.
*
* @returns { Promise<ArrayBuffer> }
* @syscap SystemCapability.Utils.Lang
* @since 9
*/
/**
* Puts the Blob data into an ArrayBuffer instance. This API uses a promise to return the result.
*
* @returns { Promise<ArrayBuffer> }
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Puts the Blob data into an ArrayBuffer instance. This API uses a promise to return the result.
*
* @returns { Promise<ArrayBuffer> }
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'11', '1.2':'20'}
* @arkts 1.1&1.2
*/
arrayBuffer(): Promise<ArrayBuffer>;
/**
* Creates and returns a new Blob containing a subset of this Blob objects data. The original Blob is not altered
*
* @param { number } [start] - start start The starting index
* @param { number } [end] - end end The ending index
* @param { string } [type] - type type The content-type for the new Blob
* @returns { Blob }
* @syscap SystemCapability.Utils.Lang
* @since 9
*/
/**
* Creates a Blob instance by copying specified data from this Blob instance.
*
* @param { number } [start] - Offset to the start position of the data to copy. The default value is 0.
* @param { number } [end] - Offset to the end position of the data to copy. The default value is the data length in the original Blob instance.
* @param { string } [type] - Type of the data in the new Blob instance. The default value is ''.
* @returns { Blob }
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Creates a Blob instance by copying specified data from this Blob instance.
*
* @param { number } [start] - Offset to the start position of the data to copy. The default value is 0.
* @param { number } [end] - Offset to the end position of the data to copy. The default value is the data length in the original Blob instance.
* @param { string } [type] - Type of the data in the new Blob instance. The default value is ''.
* @returns { Blob }
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'11', '1.2':'20'}
* @arkts 1.1&1.2
*/
slice(start?: number, end?: number, type?: string): Blob;
/**
* Returns a promise that fulfills with the contents of the Blob decoded as a UTF-8 string.
*
* @returns { Promise<string> }
* @syscap SystemCapability.Utils.Lang
* @since 9
*/
/**
* Returns text in UTF-8 format. This API uses a promise to return the result.
*
* @returns { Promise<string> }
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Returns text in UTF-8 format. This API uses a promise to return the result.
*
* @returns { Promise<string> }
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'11', '1.2':'20'}
* @arkts 1.1&1.2
*/
text(): Promise<string>;
}
}
export default buffer;
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/openharmony/interface_sdk-js.git
git@gitee.com:openharmony/interface_sdk-js.git
openharmony
interface_sdk-js
interface_sdk-js
master

搜索帮助