How can I convert stream to byte and byte to stream

I got a IInputStream from BackgroundDownloader operation, how can I convert it to byte array? I try to convert it to buffer and after that to bytes, but it's always throw exception.
function decryptStream(inputStream, totalBytes) {
var reader = new Windows.Storage.Streams.DataReader(inputStream);
var iBuffer = reader.readBuffer(totalBytes);
var bytes = Windows.Security.Cryptography.CryptographicBuffer.copyToByteArray(iBuffer);
Could I have examples about that?

Hi Jeft,
In my program, I have a BackgroundDownloader to download an image. When we have result, I will convert it to bytes array.
if (p.hasResponseChanged && imageStream == null) {
imageStream = operation.getResultStreamAt(0);
if (!p.hasResponseChanged && imageStream != null) {
decryptStream(imageStream, p['bytesReceived']);

Similar Messages

  • I want to remove the monitor from my 17" Macbook Pro 2008 to use as an external for my Macbook Pro 15" 2012. How can I convert lvds to Thunderbolt and power the monitor?

    I want to remove the monitor from my 17" Macbook Pro 2008 to use as an external for my Macbook Pro 15" 2012. How can I convert lvds to Thunderbolt and power the monitor?

    It's almost impossible.  The new iMacs have a Target Display Mode, but it's built to do that.  Without ripping your screen out, finding an acceptable power supply, frame, and whatever electronics to convert a Thunderbolt signal to the screen, the cost will be much larger than buying a cheaper HiDef monitor that runs with an HDMI to Thunderbolt cable to your MacBook 15.  In fact, you can sell your 17" MBP for a lot of money, unless it's broken or something, buying you a really sweet monitor.
    By the way, I found your answer by searching this forum.  I would suggest using the search function here in the futuere.

  • How can I convert an Hexadecimal number in bytes

    Hello!
    I have a string wich represents an hexadecimal value ( ex: C2105215767E)
    I want to convert it into byte. I want to obtain an array of byte. I want to write it into a variable : byte[]var
    How can I do it?
    Thanks you for your answer.
    cordialy,
    lafon1

    Look into the API for BigInteger. You can use a constructor that takes a String and specify the radix as 16 (hex). Big Integer includes a method to convert to a byte array.

  • How can I convert the download.m4a and Info.plist into the right audio file

    The topic is actually the problem that I have.
    I have bought music and it was downloaded successful (all of it) but iTunes had a strange freeze while converting the files into the right audio file. Some files were converted but after the freeze no more.
    I'm now left with these .tmp folders in the downloads folder which have the download.m4a and Info.plist files.
    My iTunes is able to play these download.m4a files, but they show no information and covers and this is really annoying. I could write and change it all by myself, but than I would still miss some information (and covers).
    Is there any way for me to convert or combine these files?
    Note: I'm not able to restart any downloads, because they were successful.

    Hello ed2345,
    Thanks for the help, but this is not the problem.
    It's hard to describe the problem, but I'll try it again, this time with pictures.
    I was left with the following folders in the iTunes Downloads folder.
    http://www.picfront.org/d/7yb3
    These TMP Folders have a download.m4a and a Info.plist file.
    After moving the audio files in iTunes a bit I get this.
    http://www.picfront.org/d/7yb2
    As you can see no other Information for the download.m4a than the length.
    That's how the .m4p file looks like
    http://www.picfront.org/d/7yb1
    And this is how the same .m4a file currently looks
    http://www.picfront.org/d/7yb0
    Like I said, I could edit all these download.m4a files by myself but that would leave some information out.
    Note: Sorry, I hope the links do not spam you with annoying ads. I don't get any but I was told that there can be some annoying one.

  • How can i convert an object to stream of chars or bytes?

    how can i convert an object to stream of chars or bytes?

    One way is the serialization mechanism. There are examples and explanations of it in the Java tutorial: http://java.sun.com/docs/books/tutorial/essential/io/serialization.html

  • How can I convert DVD- video into Apple's format so that it can be played and streamed from my Mac?

    How can I convert DVD- video into Apple's format so that I can play the content on my Mac and also stream it to my Apple TV? A few years ago, I transferred all of my home videos onto DVD but now would really like to put these onto my Mac and stream them through Apple TV to watch on the "big screen". Any advice would be most welcome!! Thanks

    MPEG Streamclip.
    Apple do not have their "own" format. You need to convert your DVDs to H.264 though.

  • How can I convert an array off byte into an Object ?

    Hi folks...
    I�m developing an application that comunicates a PDA and a computer via Wi-Fi. I�m using a DataStream ( Input and Output ) to receive / send information from / to the computer. Most off the data received from him is in the byte[] type...
    How can I convert an array off byte ( byte[] ) into an Object using MIDP 2.0 / CLDC 1.1 ?
    I found on the web 2 functions that made this... but it uses a ObjectOutputStream and ObjectInputStream classes that is not provided by the J2ME plataform...
    How can I do this ?
    Waiting answers
    Rodrigo Kerkhoff

    There are no ObjectOutputStream and ObjectInputStream classes in CLDC. You must know what you are writing to and reading from the DataStream. You should write the primitives like int, String to the DataOutputstream at one end and read those in exactly the same sequence at the outher end using readInt(), readUTF() methods.

  • How can I convert multiple files at one time and not one at a time

    How can I convert multiple files at one time and not one at a time

    Hi Plissey1950,
    Sorry for the lengthy delay to a response.  Are you trying to convert multiple files to individual PDF files at the same time? (not combine them).  If so, you'll need to use Adobe Acrobat for this function. The CreatePDF service does not have the ability to convert multiple files to multiple individual PDF files.
    Thanks,
    David

  • How can I record an audio sound and convert it to a ringtone?

    How can I record an audio sound and convert it to a ringtone?

    Record your voice using iPhone (for ringtone only 35 secs or under are valid), sync iPhone with iTunes.
    In iTunes the recorded voice is listed under Music as some_numbers.m4a.
    Right click on the item and choose Create AAC version.
    Drag the converted voice onto the desktop.
    Delete the voice copy in iTunes. (important step)
    On desktop, rename the some_number.m4a to something_more_intelligent.m4r
    Drag it back to iTunes and you will find it under Tones.
    Now select it (for sync) and connect your iPhone, do a sync.
    If everything works out, it will be in Settings > Sounds > Ringtone.
    Now choose a contact you want to assign this ringtone, tap Edit and add the ringtone.
    Hope this helps.

  • How can I convert my music, and CDs to MP3, for use in my vehicle's AM/FM/ Stereo? I have a 16 GB SDHC Card, that I would like to load up with some of my music.

    How can I convert my music, and CDs to MP3, for use in my vehicle's AM/FM/ Stereo? I have a 16 GB SDHC Card, that I would like to load up with some of my music.
    Thanks for any help you can furnish.
    Ed

    Well, this question really belongs in the iTunes forum, which is where you will get fast answers.
    Just go to iTunes Preferences.  Click on the General icon.  Set When you insert a CD to Ask to Import CD.  Click on Import Settings.  Set Import to MP3 decoder.  Make sure you're using Good Quality.
    This should deal with your CD's.
    With your current music, as long as it does not have DRM restrictions (older iTunes Music did), select the song, right click on the song (or group of songs), pull down to Create MP3 version. 

  • How can I convert a pages color document to a PDF Black and White doc.

    How can I convert a pages color document to a PDF Black and White doc.  Or, covert the color to B&W in a new doc?

    > How can I convert a pages color document to a PDF Black and White doc.  Or, covert the color to B&W in a new doc?
    The general idea is that you colour correct photographs once, archive, and convert with or without colour changes. The archived photograph is unchanged - or we would be colour correcting the same photographs again and again and again.
    If you have a photograph with a corrected exposure, you can open the photograph in the Apple ColorSync Utility, apply a colour space conversion to a grayscale appearance using the preinstalled ICC profile, save the photograph under another name, and place that in your pagination.
    If you have a paginated document with corrected exposures, and any such non-scalable bitmap or scalable spline graphics as you have chosen to add, you can render the pagination as a whole to PDF through the same ICC profile, carrying out the same colour space conversion on any and all objects.
    Caveat: If you intend the pagination for certain processes, in particular offset lithography, then you are probably  expected not to render the type to grayscale, but rather to render it to single ink solid black. No software can determine what printing process you intend, you have to understand a bit about printing, and how to set up general colour space conversions in software. Ask your prepress provider, and if the answer is not prompt and proficient, pick another provider.
    /hh

  • How can i watch you tube videos and video stream on my mac mini

    how can i watch you tube videos and video stream on my mac mini

    Go to youtube.com? I think I'm missing the point of your question.
    Matt

  • I recently purchased QuickTime 7 Pro to convert avi files to mov files for editing on Imovie. However, QuickTime won't play the files. How can I get them to play and how can I convert them to mov files?

    I recently purchased QuickTime 7 Pro to convert avi files to mov files for editing on Imovie. However, QuickTime won't play the files. How can I get them to play and how can I convert them to mov files?

    I recently purchased QuickTime 7 Pro to convert avi files to mov files for editing on Imovie. However, QuickTime won't play the files. How can I get them to play and how can I convert them to mov files?
    Both the AVI and the MOV file extensions refer to the file container and not the compressed data the file contains. Both are generic file containers in that each may contain any valid combination of audio and/or video data that is compatible with the codec component configuration of the system on which the file was created. On the other hand, whether a file is playback compatible, conversion compatible, and/or edit compatible depends on the data actually contained in the file container. So, you are basically dealing with two separate issues here—the container and what is inside it.
    Basically, if you want to make your files ediit compatible with iMovie, you must change your file container to one that is acceptable to iMovie and convert the data to edit compatible audio and/or video compression formats as may be necessary. The best approach is to determine what codecs were actually used to create the original AVI files and add them to your system if possible. In most cases a codec package like Perian can be added to your system's codec component configuration to may the AVI file playable. Once they are playable, in the QT 7 app then they can be chnged or converted to file types and compression formats that can be edited in iMovie. (While Perian handles most codecs commonly used to create AVI files, it does not handle all possibilities and, while the Perian codec package still works under cureent Mac OS versions, its development group has decided to drop further development/support of the package.)
    Background: AVI is a file container originally developed by Microsoft back in 1992 but for which official support was discontinued about 11 years. Despite its limitations, Windows users still tend to use this file based on its open source ease of use and generic nature, thus, making its use so popular that most users are unwilling to switch to more modern but less generic file types. Since some AVI legacy compression formats have never been transcoded for the Mac or use beyond OS 9 or OS X PPC platforms, it is often important to know what specific compression formats are contained in the AVI file to know which codecs to add to your system and which not to add in order to avoid possible codec conflicts.
    You can use many different converters to convert AVI files to iMovie edit compatible files. Most third-party apps contain their own buit-in codecs which do not relay on the Mac codec component configuration. Free ones, like HandBrake, usually have limited conversion capabilities while those that have more varied outputs are usually commercial in nature and will cost you additional cash. QT 7 Pro or the free MPEG Streamclip app allow you to access you own system's component configuration and use any available codec component like DV, AIC, MPEG-4, H.264, Photo JPEG, etc.—all of which are iMovie compatible for editing purposes—but only after making the AVI file QT 7 player compatible.
    In order to determine what compression formats wewre used in your AVI files you can
    1) Try checking the Finder "Info" window,
    2) Use the "Inspector", "Media Info", or "Properties" window of any player app that will open the file, or
    3) Use a general media utility app like "MediaInfo" to read the file characteristics.

  • How can i convert 2k resolution dpx files of a movie to DCP and will they be able to open the harddisk and view the files?

    how can i convert 2k resolution dpx files of a movie to DCP and will they be able to open the harddisk and view the files?

    AFAIK, this is beyond the capabilities of FCPX/Compressor. This company makes a plug-in, which I have to say I have no experience with. Here is a thread that may give you some other ideas. Good luck.
    Russ

  • How large can a LabVIEW Queue in elements and bytes?

    How large can a LabVIEW Queue in elements and bytes?

    rocke72 wrote:
    How large can a LabVIEW Queue in elements and bytes?
    In
    elements it is likely something like 2^31. In bytes it is most probably
    around the same number or better, depending how exactly the different
    queue elements are stored. I think they are stored as independent
    pointers so it would be theoretically better than those 2^31. In
    practice however starting to allocated so much memory in LabVIEW will
    always cause problems on nowadays computers. Without 64 bit CPU and OS
    going above 2 GB of memory per application is very hard and as far as I
    know not supported by LabVIEW.
    Also allocating many chunks of memory (like a few million queue
    elements holding strings) will definitely slow down your system tremendously eventhough
    it will work but the OS memory manager will be really stress tested
    then.
    Rolf Kalbermatter
    Message Edited by rolfk on 06-09-2006 12:24 AM
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

Maybe you are looking for

  • OSX 10.6.8 update Excel problems. When is it safe to proceed?

    I installed OSX10.6.8 and immediately had problems with Microsoft products specifically opening files using ommand o, printing all ways. I did what the boards seem to be suggesting (used disk utility to verify the disk (OK), repair permissions (Done)

  • Is the new macbook air any good for logic pro?

    hi. i currently have a heavy 15" macbook pro with i7 dual core 2.66GHz processors. i travel a lot and am really thinking about getting a macbook air. i want to know if any logic users are on the new 13" macbook air and how they find it. can it run la

  • SAML v2 communication with standalone app.

    Hi, We want to establish single signon between an AM instance integrated webapp(App1) and another proprietary webapp(App2). We are planning ot install v2 plugin in App1(In AM instance). We are not sure what exactly need to be done at App2 side, this

  • How to see Downloaded Apps?

    How to see Downloaded Apps?

  • Trying to get hypertrend to display signals

    I created a series of multistate type objects to display limit switch positions. Each display is a green light for on, and black for off. Each one is displaying the status of a bit-of word, like DL2.V17051:2 for instance. I used the database to save