How can I read bytes from std input using nextByte()

Hi. I am trying to read input text from std input into a byte array. I used the following procedure but have been getting errors
Scanner myScanner = new Scanner(System.in);
     do{
          List[i] = myScanner.nextByte();
          i++;
     }while(i<List.length);
When i try to print the List array after this loop, i get an InputMismatchException and Unknown Source error. What could be responsible for this?
Thanks

i don't really know what you're trying to do, but try this:
maybe it helps you out.
byte List[] = new byte[10];
        for (int i = 0; i < List.length; i++) {
            Scanner myScanner = new Scanner(System.in);
            List[i] = myScanner.nextByte();
        }this code creates an array of byte elements. the length of the array is 10 ( = new byte[*10*]). the for loop let's you fill the array with byte numbers over the keyboard.
good luck

Similar Messages

  • How can i read XML from local drive using Javascript into Live Cycle

    Hello,
    I am creating PDF Form using Acrobat LiveCycle.
    I want to write java script for load data into relative field and data present into xml file which is located at local drive
    I have write all method for parsing xml which is required ............... but i am stuck into how to read/open/load local drive xml using javascript?

    sandyrock:
    You'd better post this message to Adobe LiveCycle forum: http://www.adobeforums.com/webx/.3bbeda8d/
    You can use postMessage method in LiveCycle JavaScript to communicate with host application,the host application can be a web brower like IE.
    In IE you can use IE javascript to access local XML file.

  • How can we read data from spread sheet using RowSet Object ??

    Please give some sample code for this...
    Urgent requirement....please....

    http://java.sun.com/developer/Books/JDBCTutorial/chapter5.html
    �I sense many useless updates in you... Useless updates lead to defragmentation... Defragmentation leads to downtime...Downtime leads to suffering..Defragmentation is the path to the darkside.. DBCC INDEXDEFRAG and DBCC DBREINDEX are the force...May the force be with you" --
    http://sqlservercode.blogspot.com/

  • How can we read filenames from a specific folder

    Hi forum,
    I have a situation that, there are several files coming daily in a specific folder.
    I want to read filenames from that folder and want to get that filename in a variable.
    That filename contains account nos. which I need for further processing.
    Now, how can we read filenames from a specific folder with using Oracle PL/SQL Procedure?
    Please suggest.
    Thanks & regards,
    Kiran

    If you are on 10g (not sure which exact release I'm afraid) you might look at Chris Poole's XUTL_FINDFILES that lists the files in a directory using PL/SQL and DBMS_BACKUP_RESTORE.SEARCHFILES (all a bit undocumented as it seems to be provided as part of rman).
    The conventional (i.e. supported) approach is to use a Java stored procedure - there is an example on AskTom.
    Message was edited by:
    William Robertson

  • How can i send pictures from iphoto and use entourage

    how can i send pictures from iphoto and use entourage. I use to do it when I used Mac OS Leopard

    Click on the image in question and execute COMMAND D which will copy an image in iPhoto.
    To delete an image in iPhoto, execute COMMAND DELETE.
    Ciao.

  • How can i transfer msgs from iphone 4s using ios6 to iphone 5 using ios7 without removing any thing from iphone5?

    how can i transfer msgs from iphone 4s using ios6 to iphone 5 using ios7 without removing any thing from iphone5?

    Thanks for the response -I thought that may be the case. I can access all the tracks in iTunes as it's part of the iTunes Match library. Is there not a way to download the tracks that are currently on the iPhone to the MacBook? I'm not trying to transfer the purchases but download the content from the cloud.
    Have I explained myself at all well?!

  • How can I read email from my aol account from my iphone and keep it as uread on my computer at home.  It automatically goes to read mail on my computer.  On my computer if I want to keep an email to answer later I can mark it "Keep as New".

    How can I read my email from my aol account from my iphone and keep it as "unread" on my computer at home?  At home I can read an email and if I want to get back to it at a later date I can mark it as "keep as new".  I tend to forget it if it goes to "read" mail.   Right now, when I read an email from my phone it goes automatically to "read" mail.

    On the iPad, using the mail app, there is no way to do what you are asking without tapping the flag icon and marking the item as unread. Have you tried the OWA app for the iPad? It may have that functionality, but I haven't tested it as you need an Office 365 subscription with Exchange support to use the app.

  • How can I read color from frond-end PC

    Hi Everybody,
    I have en HTML- control in my GUI and I would like to adjust back ground color of my HTML page to actual client color scheme. Does anyone known how can I read the color settings from client pc?
    Best regards
    Bogdan

    Hi,
    If you are using LOAD_HTML_DOCUMENT method to load the repository object, then pass a merge_table which contains an instruction to replace the background:
    TYPE-POOLS SWWW.
      DATA: l_merge_table TYPE swww_t_merge_table,
            l_merge_item  TYPE swww_t_merge_item,
            l_html_table  TYPE TABLE OF w3html,
            l_html_line   TYPE w3_html,
            l_url         LIKE me->url.
        CLEAR l_html_table.
        l_html_line = ' '.  " No background color, use default
        APPEND l_html_line TO l_html_table.
        l_merge_item-name = '<!BACKGROUND!>'.  " Tag to be replaced
        l_merge_item-html = l_html_table.
        l_merge_item-command = ' '.     " blank means replace tag line
        APPEND l_merge_item TO l_merge_table.
        CALL METHOD html_view->load_html_document
             EXPORTING
                  document_id  = 'DOCID'
             IMPORTING
                  assigned_url = l_url
             CHANGING
                  merge_table  = l_merge_table
             EXCEPTIONS
                  OTHERS       = 1.
    I have not tried this code but hope it helps,
    Rao A

  • How can I get permission from imovie to use text in my uploaded monetized YouTube clips

    I am able to use imovie to edit movies. I use a small amount of text and no music from imovie. How do I obtain permission from imovie to use a text title for my monetized YouTube uploads?

    You do not need permission for this.

  • How can I read channels from different SCXI modules simultaneu​sly?

    Hello.
    I have a system that consists in:
    - Three E-series DAQ boards (PCI-6034, PCI-6052 & PCI-MIO-16E)
    - One SCXI chassis (SCXI 1001)
    - 4 SCXI modules for voltage measurement connected to PCI MIO 16E
    - One SCXI module for strain gauges connected to PCI 6034
    - One SCXI module for accelerometers connected to PCI 6052
    I have to develop a software application that reads all the channels at the same time or at least in the same program cycle. I have tried to create only one DAQmx task containing all the channels, although they belong to different DAQ boards (and SCXI modules, of course), but it seems to be impossible to use channels from different devices in the same task.
    So I have created three different DAQmx tasks, one for each device and its channels. I have used one "DAQmx Start Task" VI for each task at the beggining of the loop in order to use them independently, reading their channels inside the loop in every program cycle.
    When I have run the program I have get the following error:
    "ERROR -200619 ocurred at DAQmx Start Task.vi
    Chassis cannot be used for more than one scanning operation at the same time.
    Do only one scanning operation or combine multiple scanning operations into a single operation."
    What is the problem? How can I combine these multiple scanning operations? What can I do to read all channels at the same time?
    Thanks.

    Hello pablomendana,
    it's ok that you got an error when trying to use more than one device on the same task. According to the setup you have, I agree that 3 tasks should be put in place.
    The key question I have is... Have you configured manually at MAX the SG and accel. modules to be in Parallel mode?
    I would not expect the error you get if they are in parallel mode (in which you could even read directly from the DAQ board, using DAQ device channels instead of SCXI channels).
    Unfortunately, I haven't been able to setup a system similar to yours, but I would like to know more details on what you've tried so far.
    Also, I recommend you that if still need help on setting up the system, use NI's SSP program to get support from your local NI Application Engineering organization, as this will be faster than the forum.
    Regards,
    Jorge M.

  • How can I read weight from scale

    Hi,
      I want to setup SAP so that HUPAST transaction can read the weight from the scale. I could see that it looks for an RFC destination and scale name etc. But didnt succeed in creating the RFC destination
    Please let me know if a third party software is a MUST or SAP has an inbuilt software for reading scales, if so how can we configure it. We are on ECC 5.0
    Thanks for reading.

    After a few more experiments, you can get correct values from the 'bounds'-descriptor.
    function getTextExtents(text_item) {
      app.activeDocument.activeLayer = text_item.parent
      var ref = new ActionReference()
      ref.putEnumerated( charIDToTypeID("Lyr "), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") )
      var desc = executeActionGet(ref).getObjectValue(stringIDToTypeID('textKey'))
      var bounds = desc.getObjectValue(stringIDToTypeID('bounds'))
      var width = bounds.getUnitDoubleValue (stringIDToTypeID('right'))
      var height = bounds.getUnitDoubleValue (stringIDToTypeID('bottom'))
      var x_scale = 1
      var y_scale = 1
      if (desc.hasKey(stringIDToTypeID('transform'))) { 
      var transform = desc.getObjectValue(stringIDToTypeID('transform'))
      x_scale = transform.getUnitDoubleValue (stringIDToTypeID('xx'))
      y_scale = transform.getUnitDoubleValue (stringIDToTypeID('yy'))
      return { x:Math.round(text_item.position[0]), y:Math.round(text_item.position[1]) , width:Math.round(width*x_scale), height:Math.round(height*y_scale) }
    I tested that this returns correct values both when image and text box get scaled. There is some strange Photoshop behaviour to note though:
    bounds.left seems to be always 0 like one could assume
    bounds.top on the other had is most times -1-3px. This probably corresponds to the amount the actual text rises above the text box. I feel it's a bug, i.e. it should be part of content bounding box, not the text area. But maybe it's like it was specced and I'm just interpreting it wrong.
    x_scale and y_scale seem to be always equal. For example if you create a 100x100px text box and scale it to 200px horizontally, both x_scale and y_scale will be 2 and text_item.height will be 50.

  • Without loops how can i read data from associative Array??

    Hi all,
    I am facing scenario like...
    i need to read data from associative array  without using loops is it possible,
    CREATE OR REPLACE PACKAGE BODY test_pkg IS
        TYPE t1 IS TABLE OF NUMBER INDEX BY BINARY_INTEGER;
       -- in array we can expect more than one row or sometimes no data also.
      FUNCTION test1(vt1 T1 DEFAULT CAST(NULL AS t1)) RETURN NUMBER IS
      BEGIN
        -- basically in array we'll get data of column2
        -- this loop should satisfies table1.colum2 = nvl(NULL, table2.colum2 )if array is null.
        -- if array is not null then only compare with array values
        FOR i IN (SELECT t1.colum1,t1.column2
                         FROM table1 t1, table1 t2
                              WHERE t1.colum1 = t2.column1
                                AND t1.colum2 = nvl(vt1, t2.colum2)
          LOOP
            generateTEXT(i.colum1, i.colum2);
         END LOOP;
      END test1;
    END test_pkg;
    in table1 we have date like...
    colum1          column2
    Jan                  1
    Feb                  2
    Mar                  3
    if i call select test_pkg.test1(1) from dual then output should
    be Jan..
    and
    select test_pkg.test1(null) from dual then it should display all elements from table1.
    Jan                  1
    Feb                  2
    Mar                  3,
    Thanks for your quick replay..

    i need to read data from associative array  without using loops is it possible,
    No - you would need to create a SQL type and then use the TABLE operator to unnest the collection.
    create or replace TYPE my_nums IS TABLE OF INTEGER;
    DECLARE
    --  TYPE my_nums IS TABLE OF PLS_INTEGER INDEX BY PLS_INTEGER;
      v_nums my_nums := my_nums(1, 2, 3);
      v_total number;
    BEGIN
      select sum(column_value) into v_total from table(v_nums);
      DBMS_OUTPUT.PUT_LINE
        ('Sum of the numbers is ' || TO_CHAR(v_total));
    END;
    Sum of the numbers is 6

  • How Can i Read data From Maintainance View

    I Want read data from Maintainance View. i written select query
    SELECT *
    FROM J_1yyyyV
    INTO TABLE GT_BUSPLACE.
    WHERE BUPLA = LV_BUPLA.
    this is giving following error
    "J_1yyyyV" is not defined in the ABAP Dictionary as a table,
    projection view, or database view.
    Can you help me Please.
    Thanks in Advance.
    Regards,
    Raj.

    Hi raj,
    maintainance view is a nothing but combinations of table using join on some fields..
    see the relation ship between the joins..
    if you want to write selection query ..go to se11 -->enter view name >and open tab>
                    Table/Join  conditions--> see the table's involved and join conditons between tables.
    and write the select query same as like the Table/Join  conditions in se11..now you can acheive the
    table maintainance fields..
    Prabhudas

  • How can I read "Keys" from a Config File that have square brackets in them?

    I'm using the "Read Key (String).vi" from the config.llb and I'm having a problem because the key names in my file have square brackets in them. I'm creating an VI to read certain pieces of the TestStand �StationGlobals.ini� file and array elements appear as %[0] = "blah blah blah". It looks like they're not getting recognized at all. Is there a way to handle this?

    I was just looking at the code inside the configuration VIs and the way they work under V6 is that the Open VI actually reads the contents of the configuration file, parses it (in nice-platform independent G) and stores it in a fancy LV2-style global called the "Config Data Registry.vi". The routine that does the parsing is called "String to Config Data.vi". My gut reaction is that this code is going to be the same in your version because between sometime prior to V6 of LV, NI changed the location of a couple terminals on the low-level Match String function and it looks like when this code was originally written the terminals were in the old configuration.
    In any case, if your square-bracket containing strings are getting lost, this is probib
    ly where it's happening at. The other place to check is in the read VI itself. The V6 VI for reading the configuration registry is called "Config Data Get Key Value.vi". It's output is then further parsed by a function called "Parse Store String.vi" if the "read raw string?" input is set to False (the default position).
    Given that all the code for these functions are written in LV, you should be able to fix your VIs to read the strings you have in the ini file now. Which IMHO is actually the way they should work.
    Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • (How can we) Export FXG from Flash Professional using JSFL

    How can we export a selection from Flash Professional as .FXG using JSFL? It appears that this is not possible... just yet! I have added this as a feature request within the Adobe Labs site for Flash Professional. Someone at Adobe suggested that I also explore the forums, so here we are. If you would also like to have this feature added, please let Adobe know by promoting the idea.
    Our use case is this: we have a large Flash file with a library of over one thousand skins and assets that were built in Flash with Adobe's Flex Skins Templates. These stateful, graphical skins were used within a custom theme by several Flex 3 projects. Our ultimate goal is to bring these through Catalyst, maintaining their vectors, and use them to create Spark skins.
    We've got a JSFL that can export each linked library asset, as well as any frame-labeled 'state' within these clips. However, currently we are using exportPNG, which is not ideal as it flattens our vector art into raster images. We are about to try the exportSWF option, and see what Flash Catalyst does with this. Our early attemps with importing swf's haven't been too amazing.
    I'm starting to imagine some cross-product scripting in which we export symbols at a state-by-state level as .swf from Flash, then rebuild these onto layers in Illustrator, and THEN import these into Catalyst...yikes!
    Anyone have a better solution?

    Follow-up:
    Out of pure wishful thinking I decided I would just see what happened if I pretended 'exportFXG' was already a part of JSFL. Based on the signature of 'exportPNG', i tried the following lines:
      var success = fl.getDocumentDOM().exportFXG("file:///C:/mySymbol.fxg"); 
      fl.trace("success:"+success); // output: success:true 
    It worked! Fantastic! I'm not sure if exportFXG is considered still in "beta" and therefore intentionally excluded from the docs, or if it was just an oversight. But at least it gives us something to experiment with.

Maybe you are looking for

  • Saving pdf file problem

    Hello everyone. I'm trying to save a pdf file but i can't select the option "adobe pdf preset". Here's the screenshot Do you have a solution? Thanks in advance

  • Alternative to systemd

    Can anyone tell me how I can use minirc or openrc? Specifically, how do I move all my systemd scripts from systemd to the new init system? Is there any lightweight alternative compatible with systemd scripts?

  • WD ABAP UI design with workflow

    Hi All, We have a requirement of designing a UI with some text boxes, labels and a submit/cancels buttons. User 1 enter the details, clik on submit. Workflow should trigger and send the same info has to flow to user 2 for approval. Once appoved/rejec

  • SecUpd2009-003Intel on MacBook Pro 10.4.11 - will load only 99% and stop.

    I have tried at least 10 times to do the latest Security Update (SecUpd2009-003Intel) on my MacBook Pro. It flew through with no problem on my Mac Mini, but keeps stopping at 99% writing on my MacBook Pro. I have run Disk Utilities, I have run DiskWa

  • How do I make a panorama image in Elements 11 from 5 separate photos?

    How do I make a panorama image in Elements 11 from 5 seperate photos