Is there a quicker way to convert Base64 String Bitmap in OS 4.5 than what I am currently using?

I use this method to convert strings in Base64 to Bitmap.
It works fine, except that it takes too long to convert the images.

The time increases depending on the size in bytes of the image, as expected.

But I've used a few apps before BB on my 8300 appliance.
and the Base64 images are converted more rapidly than in my application.

Is there a faster way to achieve what I need or a way to improve
This code?

public convertBase64ToBitmap (String, Byte) {Bitmap image
ByteArrayInputStream bis = new ByteArrayInputStream (pImage.getBytes (), 0, pImage.getBytes () .length);
B64 Base64InputStream = new Base64InputStream (bis);
ByteArrayOutputStream Bos = new ByteArrayOutputStream();
buff Byte [] = new byte [1024];
{for (int len = b64.read (buff); len! = - 1; len = {b64.read (buff))}
Bos.Write (buff, 0, len);
}
Byte [] decoded = bos.toByteArray ();
String dd = new String (decoded);
Byte [] dataArray = dd.getBytes ();
EncodedImage encodedImage = EncodedImage.createEncodedImage (dataArray, 0, dataArray.length);
Bitmap bmp = encodedImage.getBitmap ();
return bmp;
}

Thanks in advance!

I just thought of this.  I would like to use a direct conversion, but if you want to stick with Base64InputStream

So what follows is probably more effective.

Byte [] inputBytes by performing a = pImage.getBytes () / / only for this operation once...

ByteArrayInputStream bis = new ByteArrayInputStream (inputBytes by doing one, 0, inputBytes.length);

B64 Base64InputStream = new Base64InputStream (bis);

Byte [] dataArray = IOUtilities.streamToBytes (b64);

EncodedImage encodedImage = EncodedImage.createEncodedImage (dataArray, 0, dataArray.length);
Bitmap bmp = encodedImage.getBitmap ();
return bmp;

Don't forget that you can use the Profiler to check performance.

Tags: BlackBerry Developers

Similar Questions

  • Is there a quick way to convert a file from Ia 13 13 files have separate page

    Is there a quick way to convert a file from Ia 13 13 files have separate page? I need to re-register or pull them OUT as standard PDF files, and I need to start with the files have unique page.

    Thank you.

    This is so in CS5

  • Is there a quick way to view the pages in Safari, Firefox, Opera (not Live Preview)?

    Is there a quick way to view the pages in Safari, Firefox, Opera (not Live Preview)?

    Currently no, but we have an element in our backlog in this research.

    Randy

  • Is there a quick way to numbers iTunes album titles?

    I'm in a band and have simply copied a load of our demos to iTunes as an album, with works of art, etc..

    Is there a quick way to request a track number to each song, so the album is in the right order?

    Or do I have to do a "Get Info" for each song individually and painstakingly number each song as track 1 30 ', follow 2 of 30' and so on?

    I know you can rearrange the songs in playlists easily enough, but I do like the album, with works of art, etc.

    So far I found only the method of numbering individual "Get Info", that seems terribly lengthy for what should be a simple process!

    Dougscripts website. Script called Albumize selection

  • Is there an easy way to convert the 3 tables in 1?

    LabVIEW HelloWorld:

    Is there an easy way to convert 3 one-dimentional tables in a table to two dimensions?

    as shown below?

    I tried the remodel, table vi, but could not get.

    Thank you very much for your help.

    \\carlos

    For the example shown, this seems to work.

  • Is there a quick way to rate, rank or tag to the images?

    Hello

    The title says it all really - I have about 200 clips that I need to look at and then rank. Is there a quick way to do it first (stars, tags)?

    Of course, I'm using the wrong search terms because I can't find any info on this.

    See you soon

    Ben

    Hello

    In the project Panel, you can call the display of metadata (right click on any column). In this context, choose Basic > note. You will then be able to evaluate by stars.

    Thank you
    Kevin

  • Is there a quick way to change a specific color in an image without masking or select an object?

    Is there a quick way to change a specific color in an image?  I mean, for example, slecting an object in the image and change the color of the object which may involve masking, etc..  What I want is a quick way to change the bokeh or part of the bokeh from an image to a nicer color.  Maybe something like help of the color picker to choose a specific color in the image and to be able to change all the colors with this exact value (hexadecimal number)?  Not sure if I explained it very well.  But I'm looking for something more specific while playing with the color sliders - I want to be able to choose the exact color for areas of interest of my image.

    The description you give is something that Photoshop does, but Lightroom does not.

    You can use Lightroom to brush an area to have some white balance, but this seems different from what you are trying to do (and it is not "fast" anyway)

  • Is there a quick way to encapsulate the informal in the tags [Para] text?

    I'm trying my new framework 12 trying to produce an ebook in several formats. I use the out-of-copyright Agatha Christie A MYSTERIOUS AFFAIR at STYLES.

    Is there a quick way to wrap each paragraph with a [Para] tag?

    Thanks in advance.

    TdeV1,

    With your extended description, I know now exactly what you mean. I am facing similar situations frequently, where I have several paragraphs that I need to paste it into a single element, then divide each paragraph in its own element.

    Unfortunately, FM has no native functionality to automate this process, despite the way it must be pretty common need. In my case, I'm a developer FDK and hacked together a small plugin it does. ExtendScript could also be used. If you don't want to do programming, then the other option is a conversion table. You will need to paste the content in a document completely unstructured, run the conversion process to structure, then copy the items newly covered in your DITA topic. You cannot run the conversion process on a document that currently has any structure.

    So to summarize, you must make some scripts/programs or learn how to build a conversion table. If this interests you, find conversion tables in the Structure Developer's Guide. In this case, it would be an exceptionally simple conversion table, perhaps even just a single line. If you have to do this process several times, I think it would be worth your time to study.

    Russ

  • is there a quick way to detect empty areas?

    Hello

    is there a quick and easy way to detect whether a sector of a VMDK file is not used?

    I mean:

    instead of calling VixDiskLib_Read and check if all the bytes of the sector are all zeros, is there a quick way to find out if a sector is not used?

    Reading large images, I'd find a quick way to ignore the areas serving...

    Thank you

    Francesco

    We will have a way to do this. Watch this space for announcements.

    Thank you

    Annick

  • Is there an easy way to convert graphics (imported from the common library) Composite path?

    Hi all

    This is my problem:

    I had sex with any common library grapch, and I would like to convert to a Composite path. I had been using a manual method (double click on the image and copy the compound path, and then stick it on my main layer).

    question:

    Is there an easy way to convert graphics (imported from the common library) Composite path? as a shortcut, or other?

    Image:

    forum_01.png

    Thank you before and waiting for your responses

    With the object selected, choose Modify > symbol > Break Apart. Then click Modify > ungroup.

  • Printers HP 8630 (all-in-one): ON HP 8630 is there a quick way to print from the paper locked tray (using a Mac)?

    ON theHP is 8630 printer a quick way to print from the paper locked tray (using a Mac)?  I normally print from tray 2 and special letterhead in a status bar.  It would be nice to choose letterhead in Tray 1 at time of printing without having to reset the printer manually.  Is there a way?   Jim1949

    Hi @James1949,

    The application, click file and then click on print.

  • Is there a quick way to show the pixels per inch for lots of images?

    Each year, I need to send a bunch of pictures to a printer, and I want to ensure that all have a resolution of 300 pixels per inch. Check each picture one by one in Photoshop by Image = > Image size is a bit tedious. Are there quicker ways to display the setting ppp for a large number of images?

    David

    Not sure if you are on Windows or Mac, but if you use a Windows machine in Explorer details you can view the resolution.

    Just do a right click upward in the row that contains the column headings (name, Date, Type, etc.) from here if you go down to more it gives you a list of huuuuge of what it can display for you right there in Windows Explorer.

    I hope this helps, unfortunately, if you are on a Mac I can't help you =)

  • Is there a quick way to restore catalogs of LR3?

    Hello

    I'm recovering from an accident of PC.  Because of this accident, I bought an iMac.  All my LR catalogs were backed up.  I have installed LR3.6 on my Mac computer and placed my catalogs in the catalog directory.  LR 3 see the catalogs, but of course the photo files are in a different location.  Currently, I'm clicking on blank film strip image and he told me the picture in lack and location dialog box.  I then go find the files and click on the missing file/files and checking the box to include files of proximity.  However, I do once the photo/pictures never appear in the strip of film or the grid of the library.  Finally, I realized that if I take LR, the photos re - appear.  It takes forever to find the files, then by restarting LR to see them in the cataglog.  I have several different catalogs, so you can see that it will be a long process to restore all the.  Is there a more faster/more quick way to accomplish this restoration of the catalogues?

    Thank you all in advance for your comments and help!

    Dennis

    In the library module, if you right click on the files you will receive the option put to date or location of the folder or find missing files.  Then you should be able to navigate to the new folder location.

  • Is there a quick way to change their font and all types of text caption?

    I am convert several projects Cp4 Cp5. I would change all the text captions of their current type of legend to the one I use now. Types of caption and text inside them being independent, I would change the font as well. I can do manually, of course, but is there a better way?

    Thank you

    James

    Hello

    Check if the legends of text all use the same style of the object (perhaps Style default caption)? If so, change the text captions and choose then apply this to all objects with... (in the Center, curved arrow icon). If you want to add captions more with the same style, be sure to also save this as the default style (second icon, the floppy).

    Lilybiri

  • Is there a quick way of formatting automatic photo?

    Hello

    Here's a newbie question in PhotoShop CS4. I'll do the same tasks over and over again:

    1. I get a picture of my photographer. .

    2. I want to convert to grayscale.

    3. I want to run auto levels, contrast automatic and Auto color

    4. I want to save it as a. PSD file

    Is it possible to automate these tasks? I realize they take only a few seconds to do, but I wonder if there is a way to run a script 'Macro' or some sort of automation.

    With the #1 question: if I convert each photo to grayscale, should I run Auto color at all?

    With question #2: that any order, I run my process? (My process are: convert to grayscale, run the auto levels, contrast automatic and track Auto color.) In other words, should I convert to grayscale, all levels first, then run the auto levels, etc., or isn't it important?)

    Thank you!

    It's really Basic.

    Record you an Action; Save it in an action game; and then run it on a folder of photos using annealing in Bell or Image Processor.

    I would like to enter detailed instructions, but it's all in the help files.

Maybe you are looking for

  • Move the bookmarks to the right

    I use Firefox 22. I have a shortcut button to access the bookmarks. Until recently, the bookmarks appeared on the right side just below the shortcut key. Now, they open on the left side. Any ideas on what I did to change it and how to fix it?

  • the capital file el has not completely download

    MY download has been blocked to 1.4 GB but installing OS X app appeared, I clicked and he said this: -. now how remove this copy of the application when when you press 'alt' no option does not appear. And my App Store said sorryosx el capital could n

  • Where is the option ' Save as ' for files in the cat

    Someone sent me a file that I need to save. It is not a file that will be directly opened by any application, so there is no file assocatation with her. Where is the "Save as" option that ever other app provides me with? I am running the latest Skype

  • Tecra A7 2400 a Long two short beeps after failed bios flash

    When I accidentally clicked on the .zip of the bios file, I was installing updates from toshiba. To my horror, the bios has begun to settle then froze the computer. I was unable to access the bios and I get just a black screen, that everything seems

  • cDAQ-9178 & NI 9401 - ASM: incremental Rotary encoder works is not beyond a certain frequency

    I use a chassis with a NI 9401 DIO module 9178 cDAQ.  I'm trying to convert the output of a rotary incremental encoder ASM (in radians) to rpm. Sensing head (PMIS4-20-50-240kHz-TTL24V-Z0-2M-S) Snap ring (PMIR7N-20-50-M-20) The encoder outputs 2500 pu