BlackBerry

InputStream to ByteArray on a BlackBerry

A quick and easy method to read an InputStream to a byte array is available in the IOUtilities class of the BlackBerry API.  I didn’t check if this is available pre 4.6 or not, but it does exist in 4.6

To read an InputStream directly to a byte array you can do something like this:

FileConnector fconn = (FileConnector)Connector.open("testfile.txt");
InputStream inStream = fconn.openInputStream();
byte[] byteData = IOUtilities.streamToBytes(inStream);
  • http://asp.webdevinsider.com/net-on-web-%e2%80%93-asp-net-c-vb-net-tutorials-%c2%bb-tutorial-4-visual/ .NET on Web – ASP.NET, C#, VB.NET Tutorials » Tutorial 4: Visual … | ASP WebDev Insider

    [...] Chirashi Security | InputStream to ByteArray on a BlackBerry [...]