Help with input streams

hello/
i need an InputStream for the constructor of my SAXBuilder object below.
i have this working, however, i would like to read everything from the
InputStream first and save the value into a String object before I pass the InputStream to the SAXBuilder. how do i go about doing this?
thx/f
// Open an input stream to the URL and read it into a byte array.
BufferedInputStream bufferedInput =
new BufferedInputStream(connection.getInputStream());
// Create a new SAX builder.SAXBuilder builder = new SAXBuilder();
// Read the portal response back and save it as an XML document.
Document response = builder.build(bufferedInput);

But you have now read from your input stream and need to reset it so
InputStream is = urlConn.getInputStream();
if ( is.markSupported() ) {
   is.reset();
else {
   is.close();
   is = new ByteArrayInputStream( docStr.toString().getBytes() );
Now you can pass your InputStream into your SaxBuilder, and have your string of what it contains.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

Similar Messages

  • Help with Input Sources

    Hi,
    I would really appreciate any help on the following question...
    I am trying to recieve XML through HTTP POST into a Servlet...The problem that I am encountering is that
    The DOMParser that I am using doesnt seem to like an input source being passed as an input stream..
    I get the following error :
    org.xml.sax.SAXParseException: The root element is required in a well-formed document.
    I know that the XML i am posting is Valid and that my code works, because if I substitute the input Stream with a file on my machine, it parses fine!...
    Has anyone encountered this problem, and if so can u suggest a solution????
    a snippet from the code is as follows...
    try
    reqWrapper = new HttpServletRequestWrapper(request);
    xmlin = reqWrapper.getInputStream();
    inReader = new InputStreamReader(xmlin);
    insource = new InputSource(inReader);
    rparser = new DOMParser();
    rparser.parse(insource);
    requestDocument = rparser.getDocument();
    Thanks
    for your time
    Pret.

    Hello Pretpal,
    In the sample, OTN Survey Application located at http://otn.oracle.com/sample_code/tech/xml/survey/content.html, I have used the InputSource to read the XML from an URL and this is working perfectly. The code is as follows :
    public XMLDocument parseXMLFromURL(String xmlURL) throws SurveyException{
    try{
    // Get the XML ID
    String xmlID = (new URL(xmlURL)).toString();
    // Create an InputSource
    InputSource is = new InputSource(xmlID);
    return parseXML(is);
    }catch(SurveyException surveyexp){
    surveyexp.addInformation("Method","parseXMLFromURL","XMLHelper.java");
    throw surveyexp;
    See if this code works for you. You can get more information about this method in the sample. Please check out the link provided above.
    Hope this helps,
    Thanks,
    Rajat

  • Need help with Photo Stream

    I am having issues with Photo Stream and iPhoto when the iPhoto library is stored on a Drobo NAS. When I access the library stored on the NAS I see Photo Stream on the menu and when I access the library I get a  message that tells me I need to switch Photo Stream to this Library. I did select to switch Photo Stream over to this NAS library and I did get a big blue button that is suppose to start Photo Stream but when I push it nothing happens.
    I have contacted Apple support and they said that this is the way Photo Stream works and recommended that I submit a request to have this feature added at Apple\Feedback, if it is something I would like to have. They said if enough people request this feature they will add it but that Photo Stream does not currently support an iPhoto library stored on a remote NAS or shared network drive.
    My question is has anyone found a work around for this?  If you would like to have this feature added to Photo Stream can you please submit your request to Apple so they will add it, perhaps a little sooner than later?

    I checked today and this issue has been solved with the latest iPhoto update from Apple. I am running iPhoto 9.2.3 on my Snow Leopard Server which is sharing a Drobo NAS. I am also running iPhoto 9.2.3 on my MBP running Lion and I can now open my iPhoto Library and Photostream will work with the library and even automatically create events and move all my Photostream pictures into these events within the Library. I can then close the Library on my MBP and open the same Library from my Snow Leopard server and the new Events are there and I can move them around with no problem. Thank you Apple for this fix.   Even though I cannot deal with Photostream directly from the Snow Leopard server this is a very eligant work around.

  • Help with J2ME streaming

    Hi,
    My name is Constantinos Loizou and I am a student and currently developing a project for my Master's degree.
    I need to stream audio and/or video to a PDA device. There is a trick here which is:
    The PDA must receive the stream from a multicast address. For this I have implemented a Bridge application which joins the multicast group on behalf of the PDA and receives the Multicast RTP packets (which are sent from JMStudio) and Unicasts them to the PDA.(HP iPAQ) I had no problem implementing this. The streaming is done using JMStudio player which encodes the streaming audio data into a number of encodings (DVI/RTP in my case). I choose DVI/RTP and stream a .wav audio file.
    Now I have to accept the packets and play the stream on the PDA.
    The j2me application receives all the RTP packets successfully and I can extract usefull information from the packets such as: Timestamp, sequence number, payload type. The payload type is 5 which means it is a DVI4 encoding therefor the packets are accepted without any problem. I then save the data of the packet into a byte[] array and in regular intervals (50 000 bytes) I load them into a new ByteArrayInputStream(buffer); When I try to load the BytearrayInputStream and open it with a player I get the following error message:
    javax.microedition.media.MediaException: Failed to realize Player: Malformed wave media: expected 'RIFF'
    at com.sun.mmedia.WavPlayer.doRealize(+160)
    at com.sun.mmedia.BasicPlayer.realize(+84)
    at src.ViewVideoCanvas.run(ViewVideoCanvas.java:112)
    The command I run is: player = Manager.createPlayer(input, "audio/x-wav");//create new player
    And the error occurs on player.realize();
    I believe that this happens beacause the data is encoded to DVI/rtp. I have searched a lot and found the algorithm of decompressing the DVI data but again I get the same error
    Anyway, this is a brief description of my problem and I hope you can help me.
    Contact me for any more details or help you can provide (code sammples, decoding algorithms and implementations in java)
    Thank you
    Constantinos Loizou

    Hi my name is shaun benjamin and I am sorry I dont have the solution to this problem but could you please do me a fovor. I am looking for j2me source code for an audio streaming midlet tha can stream mp3 or wav. Could you please kindly send me some source code because I am not too fimiliar with j2me and am learning.

  • TS3989 help with photo stream not making it to pc folder.. uploads a no no also..???

    the photos from My I phone photo stream,do not appear in the folder i assigned it to be in. Also when i put photos in my upload folder, they do not make it to my photo stream on m y iphone ??? ive tried everything with the help ??

    No, I certainly am not saying it's a feature; just a widely discussed issue that as far as I know has no current solution.  I was only sharing this so you were aware that you weren't alone in having this problem, and that it may not be solvable at the current time.  If you search the forums perhaps you'll find a solution I'm not aware of.

  • Search Help With Input Parameter in WebDynpro ABAP

    Hello all,
    I have been facing a problem regarding a search help I wanted to attach to an input field on my UI. The search help expects an import parameter and offers four output parameters. What I did was to create a context node based on a ddic structure. The structure has one attribute for each of the five parameters. I defined the search help for all context attributes except the importing one where I deactivated the search help. The search help is available on one of the input fields on the view and bound to one of the attributes in the context. The other context attributes are not bound to anything. The names as well as the data types are the same in the search help as well as in the ddic structure, bound to the context node.
    During WDDOINIT, I am setting the "import" context attribute. The problem is that the table with the search help parameters is empty when the search help exit is entered. Do you have any idea what I have to do in order to provide the import value to the search help?
    Thanks in advance and best regards
    Simeon

    Hi,
    By context node, do u mean that u made a drop down with values in ddic structure ,
    rather than that u can use FM 'VRM_SET_VALUES' this would be simpler if that makes sense for ur requirement.
    pls revert if any comments on it.
    regards,
    Dinesh.

  • Help with inputting from text file.

    Okay, been struggling with this for a couple days and I could really use some help.
    I need to input text one line at a time into String[] text, I'm reading from a file called "textfile.txt" and I want to store the result
    String[] text = { first_line, second_line, third_line, fourth_line...........etc}
    This works now:
    //code
    String[] test =
         { "1 2, 3 4, 5 6"
         for (int i = 0; i < test.length; i++) {
         Graph g = new Graph(test);
    // end code
    But that of course reads "1 2, 3 4, 5 6" from the code, and not from a text file. My StringTokenizer looks for a "," and makes that the end of the token, so I need to add a "," after each line as well.
    In other words, I need to turn the text file :
    "1 2
    3 4
    5 6"
    into :
    "1 2, 3 4, 5 6"
    These are just numbers to test of course, the real text file I need to input has hundreds of lines.
    Any help would be appreciated, thank you.

    I'm fairly lost. I understand that you need to read a file, and that file contains many lines which each contain a pair of numbers. But then you say (a) that you need to create an array of Strings and (b) that you need to store the result. And there's this mysterious StringTokenizer in there as well. You seem to be suggesting some solution that concatenates all the lines together, with commas between them, so that the StringTokenizer can then go through that concatenation and break it apart into the original pieces.
    Okay, here's some code that reads through a file and makes an array of Strings, one entry per line:BufferedReader in = new BufferedReader(new FileReader("textfile.txt"));
    String data = null;
    List inputs = new ArrayList();
    while ((data = in.readLine()) != null) {
      inputs.add(data);
    in.close();
    String[] lines = new String[0];
    lines = (String[]) inputs.toArray(lines);Untested, and exception handling and so forth omitted. I leave it to you to decide what to do with that array of Strings.
    PC&#178;

  • Need help with input, parsing, and loop in one program

    I am doing an assignment that is supposed to:
    # ask the user for a URL
    # For the entered URL, read all the HTML text from the page and extract all links (other URLs) and image names. These should be printed to the console window.
    # Reprompt for a URL until the user presses the cancel button.
    # Define at least one helper method that serves a practical purpose that your main method will use. Note that your method(s) should serve a useful purpose, and it should make sense that they are separated out from the main method.
    So far, I figured out how to ask if the user would like to play again, though I can't make it loop to play again. The "NO_OPTION" works fine and exits out.
    I cannot figure out at all how to ask for the URL and then use that URL to try to parse the HTML to find the links and pictures.
    for the loop, is it:
    do{
    ...//all the stuff//
    }while (option == JOptionPane.YES_OPTION) ?(I think I have to parse, looking for "img src" and "a href", anyway)
    The biggest thing I'm getting hung up about is where to start. All it'll do is ask for the URL, say there is an error, and ask if I want to do it again. Don't know how to make it loop again. Like I said, I think it's a do while loop but am not completely sure where it goes and how to have it work on the entire thing with message dialoge boxes
    To ask for the input, I was trying to make the dialoge box a string so the string would be displayed and have the links extracted
    String linkString=   
              JOptionPane.showInputDialog("Please enter a URL:");...but it obviously doesn't work like that...
    Here is the whole mess so far...I don't know what my question is because I know what I want, just not the terms to ask. help?
    import java.io.BufferedReader;
    import java.io.InputStream;
    import java.io.InputStreamReader;
    import java.net.URL;
    import java.net.URLConnection;
    import javax.swing.JOptionPane;
    public class WebPageExaminer
         public static void main(String[] args)
              String linkString=   
              JOptionPane.showInputDialog("Please enter a URL:");
        String link = null;
        URL url;
        URLConnection urlC;
        InputStream inStream;
        InputStreamReader inStreamReader;
        BufferedReader reader;
        try
        url = new URL(link);
        urlC = url.openConnection();
        inStream = urlC.getInputStream();
        inStreamReader = new InputStreamReader(inStream);
        reader = new BufferedReader(inStreamReader);
        String inputLine = reader.readLine();
        while (inputLine != null)
          System.out.println(inputLine);
          inputLine = reader.readLine();
        catch(Exception e)
          JOptionPane.showMessageDialog(null, "Error reading from file");
        } int answer = JOptionPane.showConfirmDialog(null, "Examine Another URL?", "Click Yes or NO:", JOptionPane.YES_NO_OPTION);
        if (answer == JOptionPane.NO_OPTION)
             System.out.println("Goodbye");
             System.exit(0);
              if (answer == JOptionPane.YES_OPTION)
                  System.out.println("OK!");
    }Edited by: digital.tradecraft on Mar 14, 2009 1:27 PM

    You posted the questions 20 minutes ago? Why are you bumping it. People answer questions when they know the answer.
    I tend to ignore people who expect an immediate answer.

  • I am Stuck! Need Help With Multicast Streaming Using VLC Player

    I have a Multicast network topology shown below
    and my configs
    HUB ROUTER
    no ip domain lookup
    ip domain name primestarhotel.com
    ip multicast-routing
    interface Loopback0
    ip address 5.5.5.5 255.255.255.255
    ip pim sparse-dense-mode
    interface FastEthernet0/0
    ip address 200.0.0.2 255.255.255.240
    ip pim sparse-dense-mode
    ip virtual-reassembly
    speed 100
    full-duplex
    interface FastEthernet0/1.65
    description "Server Vlan"
    encapsulation dot1Q 65
    ip address 10.1.65.1 255.255.255.0
    ip pim sparse-dense-mode
    ip virtual-reassembly
    router ospf 200
    log-adjacency-changes
    network 5.5.5.5 0.0.0.0 area 0
    network 10.1.65.0 0.0.0.255 area 0
    network 200.0.0.0 0.0.0.15 area 0
    ip route 200.1.1.0 255.255.255.252 200.0.0.1
    ip route 200.2.2.0 255.255.255.252 200.0.0.1
    no ip http server
    no ip http secure-server
    ip pim send-rp-announce Loopback0 scope 6
    ip pim send-rp-discovery Loopback0 scope 6
    ISP ROUTER
    interface FastEthernet1/0
    interface FastEthernet1/1
    no switchport
    ip address 200.0.0.1 255.255.255.240
    ip pim sparse-dense-mode
    duplex full
    speed 100
    interface FastEthernet1/2
    no switchport
    ip address 200.1.1.1 255.255.255.252
    ip pim sparse-dense-mode
    duplex full
    speed 100
    interface FastEthernet1/3
    no switchport
    ip address 200.2.2.1 255.255.255.252
    ip pim sparse-dense-mode
    duplex full
    speed 100
    router ospf 200
    log-adjacency-changes
    network 200.0.0.0 0.0.0.15 area 0
    network 200.1.1.0 0.0.0.3 area 0
    network 200.2.2.0 0.0.0.3 area 0
    SPOKE 1 Router
    interface FastEthernet0/0
    ip address 200.1.1.2 255.255.255.252
    ip pim sparse-dense-mode
    speed 100
    full-duplex
    interface FastEthernet0/1
    no ip address
    ip pim sparse-dense-mode
    ip virtual-reassembly
    speed 100
    full-duplex
    interface FastEthernet0/1.12
    description "Workstation pc"
    encapsulation dot1Q 12
    ip address 10.1.12.1 255.255.255.0
    ip pim sparse-dense-mode
    router ospf 200
    log-adjacency-changes
    network 10.1.12.0 0.0.0.255 area 0
    network 200.1.1.0 0.0.0.3 area 0
    ip route 0.0.0.0 0.0.0.0 200.1.1.1
    SPOKE 2
    interface FastEthernet0/0
    ip address 200.2.2.2 255.255.255.252
    ip pim sparse-dense-mode
    speed 100
    full-duplex
    interface FastEthernet0/1
    ip address 10.2.22.1 255.255.255.0
    ip pim sparse-dense-mode
    speed 100
    full-duplex
    router ospf 200
    log-adjacency-changes
    network 10.2.22.0 0.0.0.255 area 0
    network 200.2.2.0 0.0.0.3 area 0
    ip route 0.0.0.0 0.0.0.0 200.2.2.1
    ip route 200.2.2.0 255.255.255.252 200.0.0.1
    I have implemented multicast on the network in a hub and spoke topology. i have set up ospf routing protocol and broadcast all network and can successfully ping.
    I am currently using VLC player as my media streaming server and client. i have set up rtp streaming from the HUb router using multicast ip 224.2.2.2 and unable to broadcast the multicast traffic across the spokes 1 and 2 PC's
    I have never used vlc player  never set up multicast network before and i am struggling with this and need help.
    these are my router configs below
    http://dl.dropbox.com/u/20145606/ip%20video%20config.txt
    Message was edited by: Louis Ojuwu

    I have edited the message and the configs and topology are visible above now. instead of the links i provided

  • Help with Input Output error

    I am learning java and when I got to input output (the sample program is a BMI calculator) in my book i had to stop because i got a weird error.
    Error:
    BMICalculator.java:17 cannot find symbol
    symbol : method create(java.io.InputStream)
    location : class java.util.Scanner
    Scanner stdin = Scanner.create(System.in);
    ^
    And the line it has a problem with:
    Scanner stdin = Scanner.create(System.in);
    I would appreciate any help.

    impot java.util.*;
    public class BMICalculator {
    public static void main(String[]args) {
    final double KILOGRAMS_PER_POUND = 0.454;
    final double METERS_PER_FOOT = 0.3046;
    System.out.println("BMI Calculator\n");
    //Line it has a problem with
    Scanner stdin = Scanner.create(System.in);
    System.out.print("Enterweight (lbs): ");
    double weight = stdin.nextDouble();
    System.out.print("Enter height (feet); );
    double height = stdin.nextDouble();
    double metricWeight= weight * KILOGRAMS_PER_POUND;
    double metricHeight = height * METERS_PER_FOOT;
    double bmi = metricWeight / (metricHeight * metricHeight);
    System.out.println("A person with");
    System.out.println(" weight " + witght + " (lbs) ");
    System.out.println(" height " + height + " (feet) ");
    System.out.println("has a BMI of " + Math.round(bmi));
    }

  • Please help with video streaming

    I'm trying to play a video on a web page. I got the below
    script from
    a website tutorial, but it does not work correctly. The
    script will
    play a video in both IE and firefox browsers, but in IE, it
    will not
    show the video player controls even though I have added more
    than
    enough height.
    <OBJECT ID="MediaPlayer" WIDTH="208" HEIGHT="300"
    CLASSID="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95"
    STANDBY="Loading Windows Media Player components..."
    TYPE="application/x-oleobject">
    <PARAM NAME="FileName" VALUE="videofilename.wmv">
    <PARAM name="autostart" VALUE="true">
    <PARAM name="ShowControls" VALUE="true">
    <param name="ShowStatusBar" value="false">
    <PARAM name="ShowDisplay" VALUE="false">
    <EMBED TYPE="application/x-mplayer2"
    SRC="videofilename.wmv"
    NAME="MediaPlayer"
    WIDTH="208" HEIGHT="300" ShowControls="1" ShowStatusBar="0"
    ShowDisplay="0" autostart="1"> </EMBED>
    </OBJECT>

    That is an older site but there is a lot of information there
    8)
    John Malone
    =========
    "Canned Heat" <[email protected]> wrote in message
    news:[email protected]...
    |A followup. The site you linked to (mediacollege) does have
    a wealth
    | of info. However, for anybody else reading this post I did
    want to
    | point out that it is the same site is where I got the
    script (in my
    | original post) that didn't work. It was located here:
    |
    |
    http://www.mediacollege.com/video/format/windows-media/streaming/index.html
    |
    | So I would recommend using Joh's much simpler script, not
    the one from
    | mediacollege referenced above.
    |
    | Again, thanks John.
    |
    |
    |
    | On Fri, 23 Mar 2007 11:06:56 -0500, "John Malone" <John
    Malone@no
    | spam.com> wrote:
    |
    | >Well I couldn't get it to work in IE7..
    | >And you get the prompt to "click here to activate this
    control"
    | >here is a sample >
    | >
    | >
    http://www.xmas-i-am.com/test/video2.htm
    Autoplay when page loads.
    | >
    | >If you look at the source code on the page you will see
    I am using an external script
    | >file...
    | >This takes care of the outlined player (in IE) with the
    prompt to "click here to
    | >activate".
    | >By changing the script you can load the page without
    starting the movie.
    | >
    | >Like this..>
    | >
    http://www.xmas-i-am.com/test/video.htm
    | >
    | >Steal the code and the script (test.js or auto.js) and
    your good to go...
    | >
    | >Or look at .....>
    | >
    | >
    http://www.midistudio.com/MPlayer9/index.htm
    | >and read how......
    | >This is mostly for MIDI music but can work with video
    with minimal modifications.
    | >
    | >Also here is a good site...
    | >
    http://www.mediacollege.com/video/streaming/formats/
    | >You will need to follow the links>> to get a
    wealth of information.
    | >
    | >Hope this helps...
    | >
    | >Just an after thought...
    | >
    | >Beware of bandwidth limitations of your site this could
    cost you money!!!
    | >
    | >On that sample site(at the top) is a movie (1.3 Megs)
    that is viewed enough to cause
    the
    | >usage to be about 3 Gigs a month. (now)
    | >But at times (September) that goes up to 10~20 Gigs and
    at it's peak I had 17 Gigs a
    week
    | >usage.
    | >(It is the 911 Flash movie)
    | >
    | >Hope this helps......
    | >
    | >John Malone
    | >===============
    | >"Canned Heat" <[email protected]> wrote in message
    | >news:[email protected]...
    | >| Thanks for taking the time to test it. I want to make
    sure, tho, that
    | >| we're not talking about two different things.
    | >|
    | >| The script plays videos fine for me too. However, the
    problem is that
    | >| when playing with IE the video controls such as play,
    pause, etc are
    | >| not displayed.
    | >|
    | >| When you played it did you see the controls in IE?
    | >|
    | >| I have tested it on three machines, ones with the
    same IE version as
    | >| yours, and I get no controls. I only see the controls
    in firefox.
    | >|
    | >| Thanks,
    | >| -Dan
    | >|
    | >|
    | >| On Thu, 22 Mar 2007 15:48:02 -0500, "Eugene J. Maes"
    | >| <[email protected]> wrote:
    | >|
    | >| >Your script works fine in ie 6 with my wmv file.
    | >| >
    | >| >gene
    | >| >"Canned Heat" <[email protected]> wrote in
    message
    | >|
    >news:[email protected]...
    | >| >> I'm trying to play a video on a web page. I
    got the below script from
    | >| >> a website tutorial, but it does not work
    correctly. The script will
    | >| >> play a video in both IE and firefox
    browsers, but in IE, it will not
    | >| >> show the video player controls even though I
    have added more than
    | >| >> enough height.
    | >| >>
    | >| >> <OBJECT ID="MediaPlayer" WIDTH="208"
    HEIGHT="300"
    | >| >>
    CLASSID="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95"
    | >| >> STANDBY="Loading Windows Media Player
    components..."
    | >| >> TYPE="application/x-oleobject">
    | >| >> <PARAM NAME="FileName"
    VALUE="videofilename.wmv">
    | >| >> <PARAM name="autostart" VALUE="true">
    | >| >> <PARAM name="ShowControls"
    VALUE="true">
    | >| >> <param name="ShowStatusBar"
    value="false">
    | >| >> <PARAM name="ShowDisplay"
    VALUE="false">
    | >| >> <EMBED TYPE="application/x-mplayer2"
    SRC="videofilename.wmv"
    | >| >> NAME="MediaPlayer"
    | >| >> WIDTH="208" HEIGHT="300" ShowControls="1"
    ShowStatusBar="0"
    | >| >> ShowDisplay="0" autostart="1">
    </EMBED>
    | >| >> </OBJECT>
    | >| >
    | >|
    | >
    |

  • Need help with HP Stream Tablet 8 and 4G

    So, recently I decided I wanted to buy an HP Stream 8 tablet. I had told my mother and she bought me the stream 7 for Christmas, as no stores in our area carried the 8. However, I really wanted the 8 because the 7 didn't have the free 200MB of data, so she returned it, I covered the difference and we ordered the 8 from the Canadian website.
    It just arrived today and I'm having some issues with the free 200MB of 4G that was advertised to come with it. When I go to the Mobile Broadband section of my internet connection window, it tells me to insert a sim card. Was the sim card supposed to be in the box? Did I have to order it seperately? Does it not really come with 200MB free a month? I would really like to know how to get to this 200MB because without it I wouldn't have gone with this line of tablet. Any help would be appreciated.
    Thank you very much.
    -Wrocksum
    Full tablet information: Hp Stream 8 5901, SKU is K4F57UA#ABL

    Hey @Wrocksum ,
    Welcome to the HP Forums!
    According to the Specs listed for this tablet on the (CAN) HPShopping.ca website here (K4F57UA#ABA) it does not indicate anywhere on the page that it comes with the free 200 MB monthly plan. This model does not come with a microSIM but does have an available SIM slot for you to add a SIM card with your own provider.
    If you view the Stream 8 on the (US) HPShopping.com website here (K4F55UA#ABA) it does show that it comes with the 200 MB monthly plan. This model comes with a microSIM that can be used on the free plan, or you can use your own microSIM for your own plan.
    The free 200 MB offer is only available on select SKUs in the US only, as noted on the HPShopping.com website.
    Thanks.
    Please click the "Kudos, Thumbs Up" at the bottom of this post if you want to say "Thanks" for helping!
    Please click "Accept as Solution" if you feel my post solved your issue, it will help others find the solution.
    The Great Deku Tree
    I work on behalf of HP.

  • Help with USB streaming

    I have a Hauppauge USB live adapter connected to my computer and am trying to get streaming video into an applet. I captured it in JMStudio and it works fine, but when I try to put it into an applet or applcation, the screen is there, but it is all black. Here is one way I tried to do it using the media player sample from sun:
    import java.awt.*;
    import java.applet.*;
    import javax.media.bean.playerbean.*;
    import javax.swing.*;
    import javax.swing.event.*;
    import java.io.*;
    import javax.media.*;
    import javax.media.format.*;
    import javax.media.util.*;
    import javax.media.control.*;
    import javax.media.protocol.*;
    import java.util.*;
    import java.awt.*;
    import java.awt.image.*;
    import java.awt.event.*;
    import com.sun.image.codec.jpeg.*;
    public class MediaPlayerSample extends Applet
    Player player = null;
    MediaLocator ml = null;
    CaptureDeviceInfo di = null;
         public void init()
              //{{INIT_CONTROLS
              setLayout(null);
              setSize(518,347);
    String str2 = "vfw:Microsoft WDM Image Capture (Win32):0";
    di = CaptureDeviceManager.getDevice(str2);
    ml = di.getLocator();
    try
    player = Manager.createRealizedPlayer(ml);
    player.start();
    catch (Exception e)
    e.printStackTrace();
    mediaPlayer1.setPlayer(player);
              add(mediaPlayer1);
              mediaPlayer1.setBounds(36,24,324,272);
              //{{REGISTER_LISTENERS
              SymComponent aSymComponent = new SymComponent();
              this.addComponentListener(aSymComponent);
              SymContainer aSymContainer = new SymContainer();
              this.addContainerListener(aSymContainer);
         public void stop()
         if (mediaPlayer1!=null)
         mediaPlayer1.stop();
         public void destroy()
         if (mediaPlayer1!=null)
         mediaPlayer1.deallocate();
    if (player != null)
    player.deallocate();
         //{{DECLARE_CONTROLS
         javax.media.bean.playerbean.MediaPlayer mediaPlayer1 = new javax.media.bean.playerbean.MediaPlayer();
         class SymComponent extends java.awt.event.ComponentAdapter
              public void componentShown(java.awt.event.ComponentEvent event)
                   Object object = event.getSource();
                   if (object == MediaPlayerSample.this)
                        MediaPlayerSample_ComponentShown(event);
         void MediaPlayerSample_ComponentShown(java.awt.event.ComponentEvent event)
              // to do: code goes here.
              MediaPlayerSample_ComponentShown_Interaction1(event);
         class SymContainer extends java.awt.event.ContainerAdapter
              public void componentRemoved(java.awt.event.ContainerEvent event)
                   Object object = event.getSource();
                   if (object == MediaPlayerSample.this)
                        MediaPlayerSample_ComponentRemoved(event);
         void MediaPlayerSample_ComponentRemoved(java.awt.event.ContainerEvent event)
              // to do: code goes here.
              MediaPlayerSample_ComponentRemoved_Interaction1(event);
         void MediaPlayerSample_ComponentShown_Interaction1(java.awt.event.ComponentEvent event)
              try {
                   mediaPlayer1.start();
              } catch (Exception e) {
         void MediaPlayerSample_ComponentRemoved_Interaction1(java.awt.event.ContainerEvent event)
              try {
              mediaPlayer1.stop();
                   mediaPlayer1.deallocate();
              } catch (Exception e) {
    Im not getting any errors with it, it just is black instead of pushing the image to the screen. Any help would be greatly appreciated (I have to demo this on friday).
    Thanks

    I am currenty a college student trying the same thing. I am very early in the development stage though, so I am more interested in finding some information about streaming raw data from a usb (or possibly firewire 800) device into a Java application as video.
    Any help would be awesome!

  • HT201317 Help with photo stream?

    I have photo stream turned on at my mac and at my Iphone. In Iphoto, I clicked on an album to share to my photo stream, but it won't show up on my phone. Help?

    Hi teacheryo,
    If you are having issues getting Photo Stream to behave as expected, you may want to take a look at the following article:
    iCloud: Photo Stream troubleshooting
    http://support.apple.com/kb/ts3989
    Cheers,
    - Brenden

  • Making a Quiz in Flash. Need help with input time

    Hi Flash Community,
    I'm making currently a quiz using Flash Pro CS5. What I want to implent is a time bar which will load once the bar is loaded it will go to the next frame.
    So what I need is first a timer which will start immediately when the user sees the question and I need a time bar which will indicate how far the timing is. So let's say you have 30 seconds to answer the quiz. When the timer is at 15 seconds the bar will be at half.
    Something like this http://www.google.nl/imgres?imgurl=http://theportablegamer.com/wp-content/uploads/2009/10/ question.jpg&imgrefurl=http://theportablegamer.com/tag/quizquizquiz/&usg=__xsykgRnehmB9P97 gg3W9tAx2Dfg=&h=320&w=480&sz=57&hl=nl&start=0&sig2=tdKlW2Iv6zHo3THsHwdVpQ&zoom=1&tbnid=ToM bL22o-D7BOM:&tbnh=107&tbnw=160&ei=aiz7TcGONI2gOpic0b4E&prev=/search%3Fq%3Dquiz%2Binterface %26um%3D1%26hl%3Dnl%26sa%3DN%26biw%3D1902%26bih%3D909%26tbm%3Disch&um=1&itbs=1&iact=rc&dur =317&page=1&ndsp=68&ved=1t:429,r:13,s:0&tx=100&ty=47
    Could anyone help me with this? How do I need to do this?
    Thanks!

    Create a movieclip with tween about 30 frames and actions stop() in the first frame
    AS3 code:
    import flash.utils.Timer;
    var timer:Timer=new Timer(1000);
    timer.addEventListener(TimerEvent.TIMER,fn);
    timer.start();
    function fn(e:TimerEvent):void{
        trace(mc.currentFrame);
        if (mc.currentFrame==30){
            timer.removeEventListener(TimerEvent.TIMER,fn);
        mc.gotoAndStop(mc.currentFrame+1);
    AS2 code:
    var n=setInterval(mcfn,1000);
    function mcfn(){
        trace(mc._currentframe);
        if (mc._currentframe==30){
            clearInterval();
        mc.gotoAndStop(mc._currentframe+1);

Maybe you are looking for

  • Constant Disconnection from Cellular Network

    Hi There, so I've gotten my iPhone 5 32GB since July 2013 and I honestly adore the phone however, there is a problem i'm facing with it quite recently.... the phone keeps disconnecting from the cellular network carrieer every 10 secs of the day... so

  • Unable to view the image in Oracle Mapbuilder

    Hi, I am unable to view the image using oracle mapviewer. It stated that: No spatial data to render... INFO [oracle.sdovis.CacheMgr2] Spatial Data Cache opened. Region=SDOVIS_DATA. INFO [oracle.sdovis.CacheMgr2]      max_cache_size=32 MB. INFO [oracl

  • Resetting Selection from a Multi-Select Dashboard Prompt in OBIEE 11g

    Hi all, I have a dashboard prompt, containing 3 columns which all are set to allow multi selection and default value is all values. In 10g, after choosing some values in one of the prompt and clicking Go button, I can manually remove all my selection

  • Captivate 8: Can you convert a responsive project to a non-responsive project?

    My co-worker created a responsive project, but she didn't really understand the use case for responsive design, and now we have a bunch of learners who can't view the HTML5 (they have antiquated browsers that they cannot update) and I need a quick fi

  • If I turn off Mac Mini Mid2011, LED doesn't turn black.

    I turned off the Mac Mini Mid 2011. BUT, the Mac Mini's Light(White LED) doesn't want to turn off and the only way to COMPLETELY shut down is to force shut down.I'm worrying about bad sectors so I'm asking. Is there any way to solve?