Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

How to create TiBlob to send on TCPSocket?


I didn't find any documentation on TiBlob. The TCPSocket.write documentation says that the arguments passed can be a blob or a string.

How can I create a blob data object to send binary data on the TCP Socket?


— asked June 12th 2010 by Gaurav Srivastva
  • binary
  • data
  • iphone
  • tcpsocket
  • tiblob

1 Answer

  • You get a blob from some methods & properties - like .toImage() - which you can then use as data for the socket.

    I don't think it's possible to create one explicitly but you can fake it using files with createFile, write, close, open & then read - which returns a blob of the contents.

    — answered July 3rd 2010 by David Ashwood
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.