define(["Ti/_/declare","Ti/_/Evented","Ti/Blob","Ti/Codec"],function(t,e,n,s){var i;return i=t("Ti.Buffer",e,{constructor:function(t){t&&t.value&&this._set(t.value)},append:function(t,e){var n=t.value;return e=0|e,length=length||n.length,this._set(this.value+n.substring(e,e+length)),length-e},clear:function(){this._set("")},clone:function(t,e){return new i({value:t?this.value.substring(t,e&&t+e):this.value})},copy:function(t,e,n,s){var i=t.value,e=0|e,n=0|n,u=Math.max(this.length,s&&n+s)-e,t=i.substring(n,u);this._set(this.value.substring(0,e)+t+this.value.substring(e,t.length-e))},fill:function(t,e,n){if(!t)throw new Error("Missing fillByte argument");e=0|e,n=this.length-e-n|0,this._set(this.value.substring(0,0|e)+new Array(n).join((t+" ").charAt(0))+this.value.substring(n))},insert:function(t,e,n,s){t.value;return n=0|n,e=0|e,this._set(this.value.substring(0,e)+v.substring(n,s&&n+s)+this.value.substring(e)),s||v.length},release:function(){this.length=0},toBlob:function(){return new n({data:this.value})},toString:function(){return""+this.value},_set:function(t){this.__values__.constants.value=""+t},_resize:function(t,e){t=0|t,this._set(this.value.substring(t,e&&t+e|0))},constants:{byteOrder:s.LITTLE_ENDIAN,type:s.CHARSET_UTF8,value:""},properties:{length:{get:function(){return this.value.length},set:function(t,e){return e>t?this._resize(0,t):this.__values__.constants.value+=new Array(t-e).join(" "),t}}}})});