Skip to content

Commit 32da366

Browse files
committed
feat(buffer): add method to convert Buffer to Ti.Buffer
1 parent 32445b6 commit 32da366

File tree

1 file changed

+8
-0
lines changed
  • common/Resources/ti.internal/extensions/node

1 file changed

+8
-0
lines changed

common/Resources/ti.internal/extensions/node/buffer.js

+8
Original file line numberDiff line numberDiff line change
@@ -863,6 +863,14 @@ class Buffer {
863863
returnbufferToUTF16String(this._tiBuffer,this.byteOffset,this.length);
864864
}
865865

866+
/**
867+
* Provides a conversion method for interacting with Ti APIs taht require a Ti.Buffer
868+
* @returns {Ti.Buffer} the underlying Ti.Buffer backing this Buffer instance
869+
*/
870+
toTiBuffer(){
871+
returnthis._tiBuffer;
872+
}
873+
866874
/**
867875
* Creates and returns an iterator for buf values (bytes)
868876
* @returns {Iterator}

0 commit comments

Comments
 (0)
close