Problem with byte[].length

dear sir
I am working with javacard 2.2.2, windows, jdk 1.5 and JCWDE
I would like to know the byte length of an array ("aCrypter" in this fallowing code)
1     public byte[] cryter(byte[] Crypter){
2
3          ecipher.init(key, Cipher.MODE_ENCRYPT);
4          ecipher.doFinal(Crypter, (short)0, (short)aCrypter.length, donneeCrypter , (short)0);
5          
6          return donneeCrypter;
7     }
JCVM return an error on line 4 (it works with "(short)1"
there is a solution to know the array length?
regards
Alexis
Edited by: Alexis "le francais" on 21 mars 2011 07:33

thanks for your help.
In fact I would like to crypt and after decrypt with this fallowing code:
       private byte[] Crypto = {(byte)0xA0, (byte)0x00,
             (byte)0x00, (byte)0x00, (byte)0x62, (byte)0x03, (byte)0x01, (byte)0x0C,
             (byte)0x0f, (byte)0x01, (byte)0x01};
public void process(APDU apdu) throws ISOException {
          // TODO Auto-generated method stub
          byte[] buffer = apdu.getBuffer();
          if (this.selectingApplet()) return;
          if (buffer[ISO7816.OFFSET_CLA] != CLA_MONAPPLET) {
               ISOException.throwIt(ISO7816.SW_CLA_NOT_SUPPORTED);
          switch (buffer[ISO7816.OFFSET_INS]) {
               case INS_INTERROGER_COMPTEUR:
                    tab = new byte[1000];
                    tab[0]= compteur;               
                    tableau = cryter(tab);
                    tableau2= decrypter(tableau);                    
                    apdu.setOutgoing();
                    apdu.setOutgoingLength((short) 7);
                    apdu.sendBytesLong(tableau2,(short) 0, tableau2.lenght);
                    break;          
     public void initialisation(){
        key = (DESKey)KeyBuilder.buildKey(KeyBuilder.TYPE_DES_TRANSIENT_DESELECT,KeyBuilder.LENGTH_DES, false);
        key.setKey(Crypto, (short)0);
        ecipher = Cipher.getInstance(Cipher.ALG_DES_CBC_ISO9797_M2,false);
     public byte[] decrypter(byte[] aDecrypter){
          ecipher.init(key, Cipher.MODE_DECRYPT);
          donneeDecrypte = new byte[10000];
          ecipher.doFinal(aDecrypter, (short)0, (short)aDecrypter.length, donneeDecrypte, (short)0);
          return donneeDecrypte;
     public byte[] cryter(byte[] Crypter){
          ecipher.init(key, Cipher.MODE_ENCRYPT);
          donneeCrypter = new byte[10000];
          ecipher.doFinal(Crypter, (short)0, (short)Crypter.length, donneeCrypter, (short)0);
          return donneeCrypter;
     }Now "crypter" method is executed, but when the debugger is at this fallowing line there is a problem :
tableau2= decrypter(tableau);maybe the size of the array?
>
return ecipher.doFinal(aCrypter);
>
I work with Javacard 2.2.2, this method does not exist in the API only :
abstract short doFinal270(byte[] inBuff, short inOffset, short inLength,byte[] outBuff, short outOffset)Edited by: le francais on 22 mars 2011 03:07

Similar Messages

  • Problem with offset length

    Hi,
    i have a problem with offset length please see below code and suggest :
    data: content_new                LIKE soli-line.   "It has a length of 255 charecter
    content_new = 'MTE:SD0\nwssd01_SD0_00\CPU\CPU_Utilization'.
    content_new = content_new+4(251).
    it is giving result:
    content_new = SD0\nwssd01_SD0_00\CPU\CPU_Utiliza  "it is removing last 4 charecter of UTILIZATION also
    while i need :
    content_new = 'SD0\nwssd01_SD0_00\CPU\CPU_Utilization'.
    can anyone plz help me?
    regards.
    Moderator Message: Duplicate Post.
    Edited by: kishan P on Oct 28, 2010 9:44 AM

    You can find string length first. Subtract length by 4,  Then use like new = str+4(len), use condense if required.

  • Problem with path length when using oracle drive

    Hello!
    Does anybody else experience this problem with Oracle Drive?
    When I create a deep or nested hierarchy in which the path length is longer than 250 (the limit might be 255) characters, I cannot access the deeper subpages.
    Example:"X:\INET\START1\pfadlaengentest\das istein langer ordnername mit etwa 50 zeichen\and this is another veryveryvery long\and this is another veryveryvery lon2\and this is another veryveryvery lon3\and this is another veryveryvery lon4\and this is another veryveryvery lon5".
    I can access the page "and this is another veryveryvery lon4" but not "and this is another veryveryvery lon5"
    Is this problem due to WebDAV?
    What can I do - I think it is a critical error / bug?
    Regards Joerg.

    I opened a service request and oracle support could help me.
    The problem is the windows file system: the path length cannot be longer than 256 chars.
    There's a workaround with MS-Webfolders.
    More information is available via metalink: watch out for SR-Number 5659267.992.
    PS: Thanks to Bert
    bye :-j (joerg)

  • Problem with field-length in sql-loader

    Hello,
    (sorry I see it's the wrong forum -> SQL-Developer, I searched for SQL-Loader, is there a possibility to change the forum ?)
    I can't find an answer for my question at google, so I hope there is someone in this forum who can help me.
    I have a dat-File that contains 12 500 000 records and want to laod it via sql-loader. The first field contains the ID and there were numbers from 1 to 12 500 000 stored.
    When I run the sql-loader, the ID run up to 9 999 999 and then, for the last 2 500 001 records, ist starts at 1 again.
    I noticed a few things :
    1. Numbers < 10 000 000 don't make Problems
    2. Numbers >= 10 000 000 make Problems, the first digit ( in this example "1") is cut, so the number "10 000 001" ist stored as "1". It comes to double entries (IDs 1 to 2 500 000).
    3. The same field-definition, I have for the third field of the record -> there is no Problem. THERE I can store any number.
    4. I tried to store a number > 100 000 000 -> the first digit was cut too, but ONLY the first digit.
    5. I'm able to store any number manually in the Database.
    So, I have a problem with the first field. If the number is greater then 10 000 000, the first Number is cut. It doesn't make any differance, if the number is 10 000 000 or 999 999 999, just the first digit, in the first field, is cut.
    Any idea ??????????
    Here some infos :
    Database :
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
    SQL-PLUS :
    SQL*Plus: Release 10.2.0.4.0 - Production
    Script sqlldr :
    sqlplus ${schema}/$2 <<EOF >>LOAD.LOG
    set timing on
    set echo on
    set heading off
    set heading on
    !sqlldr userid=${schema}/$2 control=surface_geometry.ctl log=surface_geometry.log
    exit
    EOF
    ctl-File :
    LOAD DATA
    INFILE imp_surface_geometry_test2
    TRUNCATE
    CONTINUEIF NEXT(1:1) = '#'
    INTO TABLE SURFACE_GEOMETRY
    FIELDS TERMINATED BY '|'
    TRAILING NULLCOLS (
    ID INTEGER EXTERNAL ,
    GMLID,
    GMLID_CODESPACE,
    PARENT_ID NULLIF PARENT_ID = BLANKS,
    ROOT_ID NULLIF ROOT_ID = BLANKS,
    IS_SOLID,
    IS_COMPOSITE,
    IS_TRIANGULATED,
    IS_XLINK,
    IS_REVERSE,
    GEB_ID,
    GEOMETRY COLUMN OBJECT
    SDO_GTYPE INTEGER EXTERNAL,
    SDO_SRID CONSTANT 31468,
    SDO_ELEM_INFO VARRAY TERMINATED BY '|/'
    (X FLOAT EXTERNAL),
    SDO_ORDINATES VARRAY TERMINATED BY '|/'
    (X FLOAT EXTERNAL)
    Table-Definition (sql-File) :
    CREATE TABLE SURFACE_GEOMETRY (
    ID NUMBER,
    GMLID VARCHAR2(256),
    GMLID_CODESPACE VARCHAR2(1000),
    PARENT_ID NUMBER,
    ROOT_ID NUMBER,
    IS_SOLID NUMBER(1,0),
    IS_COMPOSITE NUMBER(1,0),
    IS_TRIANGULATED NUMBER(1,0),
    IS_XLINK NUMBER(1,0),
    IS_REVERSE NUMBER(1,0),
    GEB_ID CHAR(7),
    GEOMETRY MDSYS.SDO_GEOMETRY,
    CONSTRAINT c_unique_id UNIQUE (ID))
    storage (initial 1M next 1M maxextents 1024) ;
    Some Entries in the dat-File :
    12556067| |XXX|12556066|12556066|0|0|0|0|0| |
    #3003|1|1003|1|/
    #4479400.000000|5333360.000000| 526.870000|4479380.000000|5333360.000000| 526.720000|4479400.000000|5333340.000000| 526.980000|4479400.000000|5333360.000000| 526.870000|/
    12556068| |XXX| |12556068|0|0|1|0|0| |
    #||/
    #|/
    12556069| |XXX|12556068|12556068|0|0|0|0|0| |
    #3003|1|1003|1|/
    #4479380.000000|5333380.000000| 526.600000|4479380.000000|5333360.000000| 526.720000|4479400.000000|5333360.000000| 526.870000|4479380.000000|5333380.000000| 526.600000|/
    log-File : (100 records for the test)
    SQL*Loader: Release 10.2.0.4.0 - Production on Fr Mai 28 15:16:43 2010
    Copyright (c) 1982, 2007, Oracle. All rights reserved.
    Kontrolldatei: surface_geometry.ctl
    Datendatei: imp_surface_geometry_test.dat
    Fehlerdatei: imp_surface_geometry_test.bad
    Datei für zurückgewiesene Sätze: nichts spezifiziert
    (alle Discards zulassen)
    Zu ladende Anzahl: ALL
    Zu überspringende Anzahl: 0
    Zulässige Fehler: 50
    Bind-Array: 64 Zeilen, maximal 256000 Bytes
    Fortsetzung: 1:1 = 0X23(Zeichen '#'), im nächsten physischen Satz
    Benutzer Pfad: Konventionell
    Tabelle SURFACE_GEOMETRY, geladen von jedem logischen Satz.
    Insert-Option in Kraft für diese Tabelle: TRUNCATE
    Option TRAILING NULLCOLS ist wirksam
    Spaltenname Position Läng Term Eing Datentyp
    ID FIRST * | CHARACTER
    GMLID NEXT * | CHARACTER
    GMLID_CODESPACE NEXT * | CHARACTER
    PARENT_ID NEXT * | CHARACTER
    NULL wenn PARENT_ID = BLANKS
    ROOT_ID NEXT * | CHARACTER
    NULL wenn ROOT_ID = BLANKS
    IS_SOLID NEXT * | CHARACTER
    IS_COMPOSITE NEXT * | CHARACTER
    IS_TRIANGULATED NEXT * | CHARACTER
    IS_XLINK NEXT * | CHARACTER
    IS_REVERSE NEXT * | CHARACTER
    GEB_ID NEXT * | CHARACTER
    GEOMETRY DERIVED * COLUMN OBJECT
    *** Felder in GEOMETRY
    SDO_GTYPE NEXT * | CHARACTER
    SDO_SRID CONSTANT
    Wert ist '31468'
    SDO_ELEM_INFO DERIVED * VARRAY
    Abschlusszeichenfolge : '|/'
    *** Felder in GEOMETRY.SDO_ELEM_INFO
    X FIRST * | CHARACTER
    *** Feldende in GEOMETRY.SDO_ELEM_INFO
    SDO_ORDINATES DERIVED * VARRAY
    Abschlusszeichenfolge : '|/'
    *** Felder in GEOMETRY.SDO_ORDINATES
    X FIRST * | CHARACTER
    *** Feldende in GEOMETRY.SDO_ORDINATES
    *** Feldende in GEOMETRY
    Tabelle SURFACE_GEOMETRY:
    100 Zeilen erfolgreich geladen.
    0 Zeilen aufgrund von Datenfehlern nicht geladen.
    0 Zeilen nicht geladen, da alle WHEN-Klauseln fehlerhaft waren.
    0 Zeilen nicht geladen, da alle Felder NULL waren.
    Zugewiesener Bereich für Bind-Array: 232576 Bytes (64 Zeilen)
    Byte in Lese-Puffer: 1048576
    Gesamtzahl der übersprungenen logischen Datensätze: 0
    Gesamtzahl der gelesenen logischen Datensätze: 100
    Gesamtzahl der abgelehnten logischen Datensätze: 0
    Gesamtzahl der zurückgewiesenen logischen Datensätze: 0
    Lauf begonnen am Fr Mai 28 15:16:43 2010
    Lauf beendet am Fr Mai 28 15:16:43 2010
    Abgelaufene Zeit: 00:00:00.19
    CPU-Zeit: 00:00:00.01
    Edited by: user9338988 on 28.05.2010 06:21

    sorry, wrong forum. I opened the thread in forum "Export/Import/SQL-Loader & External Tables"

  • Problem with Bytes

    i've recently started learning java, and i am having a few problems with writeing to files.
    for example:
         FileWriter outWriter = new FileWriter("file.txt");
         char i = 1;
    char z = '1'
         outWriter.write(i);
         outWriter.write(z);
         outWriter.close();
    this produces the output '1',
    it doesnt seem a problem untill you want to include loops such as:
    for (int count = 0; count < 100; count++)
    outWriter.write(count);
    this will produce the output '23456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abc'
    how would i get it to produce '50 51 52' etc. i have been experimenting and i cant seem to find a solution.
    and sujestions would be very welcome.
    Thanks,
    Xen

    well i wouldn't call it a weakness, it follows the Unicode (3) standard. Therefore all characters (char and Character) have a value assosiated with it.: A = 65, a = 97 etc etc.
    Therefore, when you are using the char i = 1, the value of the "internal int" is set to 1. But when you use '1' the internal int is set to the intvalue that corresponds to the character 1, witch is 49. So the "real" intvalues for your chars are:
    i = 1
    z = 49
    When you write this to your file, and open the file with a texteditor it will translate 1 and 49 to the corresponding cahracters (1 is not a printable cahracter so you get [] insted). If you open the file in a hex-editor, then you would se the values 1 and 49 (probably as 01 and 31 as it will display it in hexvalues).
    Anyhow the proposed solution should work, you can also use the write(String str, int off, int len) - specified by API for OutputStreamWriter - to write a complete String to the file.
    Poul Krogh

  • Problem with columns length under Firefox

    I have a problem with Firefox. Possibly, someone could help?
    If you look at the following page www.tregor.fr using IE or
    Netscape, there is no problem.
    If you use Firefox, you will see that the display of the
    bottom page is not correct. The middle column is longer than the
    left and the right columns.
    So the bottom block is not correctly sticked to the middle
    block (the body background color appears at the bottom of the first
    and third columns).
    As I analyses, I saw that, under FireFox, the text in the
    middle column seems to start a little lower than under IE or
    Netscape. This may explain why the middle column is longer.
    But I have no mean to avoid this.
    Does anyone has experienced such a problem?
    Regards.

    you could try this:
    http://www.projectseven.com/tutorials/css/pvii_columns/index.htm

  • Replacing 20 fixstatements by Global Variable - Problem 255 bytes length

    Hello,
    we have an issue in businessrules with setting the fix statement on 1 dimension:
    we currently use Fix (@RELATIVE("CBU_ALL",0) ) - on level 0 are approx. 3000 members - on medium level are 20 CBUs Seat and 20 CBUs Door
    we have approx. 20-30 similar businessrules - which either calculate on seat or door CBUs
    the requirement is to either calculate with a rule the 20 CBUs for Seats or the 20 CBUs for Doors
    as we currently do not fix properly on either Seat or Door CBUs, we calculate approx. 1500 empty members (empty, if fix in another dimension done correctly) - tests showed, that this doubles the time which would be needed.
    I know we could easily set 20 fixes in each business rule:
    @RELATIVE("CBU_BMW_Seat",0)
    ....20 more....
    @RELATIVE("CBU_Ford_Seat",0)
    (the fix above would then exclude the 1500 members, which are below:
    @RELATIVE("CBU_BMW_Doors",0)
    ....20 more....
    @RELATIVE("CBU_Ford_Doors",0)
    unfortunately, the number of CBUs/Customers is frequently renamed or some are added, so I can not afford to built these 20 fixstatements into 20 different businessrules and maintain them all the time.
    I thought of using UDAs or Attribute Values -
    but it seems not to be possible in a fixstatment to combine a relative or Children fixstatement with UDAs, which are set on the upper member ?
    I assume it works, if I classify all 3000 level 0 members with UDA or attribute SEATS or DOORS - but that's inefficient
    @RELATIVE("CBU_BMW_Seat",0) AND @UDA(CBU,"SEATS")
    @CHILDREN("CBU_BMW_Seat") AND @UDA(CBU,"SEATS")
    @Descendants("CBU_BMW_Seat") AND @UDA(CBU,"SEATS")
    @UDA(CBU,"SEATS")
    generally, it seems not to be allowed to combine Children or descendant fixes with any other relations or conditions ?
    @CHILDREN(@Match(CBU," Seat") ) (attempt to search for all children of all CBUs with Seat in its name)
    So the idea is to define 2 global variables:
    1 for Seats and 1 for Doors:
    [SEAT] includes then then: @children("CBU_BMW_Seat") ... 20 more @children("CBU_Ford_Seat")
    advantage would be, we can maintain the list of CBUs in 1 place
    my problem is: length of global variable is limited to 255 bytes - I need 800 to 900 digits to define the 20 CBUs
    having 8 global variables instead of 40 CBUs referenced in Fixstatements is not really an advantage
    even if I would rename the CBUs to just S1,S2,S3,S4 D1,D2,D3 (S for Seat, D for Door) (and use aliases in Planning and Reporting with full name to have the right meaning for the users), it does not fit into 1 variable: @children("S1"), @Children("S2"), ..... is simply too long (still 400 digits)
    also other attempts to make the statement shorter, failed:
    @children(@list("CBU_BMW_Seat","CBU_Ford_Seat",.....)) is not allowed
    is there any other idea of using global variables, makros, sequences ?
    is there a workaround to extend global variable limit ? we have release 9.3.1 - is this solved in future releases ?
    are there any other commands, which I can combine in clever way in fixstatements with
    @relative
    @children
    @descendants
    with things like @match @list ?
    (Generation and Level are no approrate criteria for Separating Seat and Doors, as the hierarchy is the same)
    please understand, that as we use this application for 5 years with a lot of historic data and it's a planning application with a lot of webforms and financial reports, and all the CBU members are stored members with calculated totals and access rights and setup data on upper members,
    I can not simply re-group the whole cbu structure and separate Seats and Doors just for calculation performance
    CBU dimension details is like this:
    Generation:
    1 CBU_ALL
    2 CBU_BMW
    3 CBU_BMW_Seat
    4 Product A
    4 Product B
    ..... hundreds more
    3 CBU_BMW_Door
    4 Product C
    4 Product D
    .... hundreds more
    2 CBU_Ford
    3 CBU_Ford_Seat
    4 Product E
    4 Product F
    .... hundreds more
    3 CBU_Ford_Doors
    4 Product G
    4 Product H
    .... hundreds more
    20 more CBUs with below 20 CBUs Seat and 20 CBUs Door

    How hard would it be to insert 2 children under CBU_All? Name them CBU_Seats and CBU_Doors, then group all the Seats and Doors under them.
    Then your calc could be @Relative(CBU_Doors, 0).
    I know it's not always easy or feasible to effect change to a hierarchy, but I just had the thought.
    Robert

  • Urgent Please!! Problem with BYTE

    Hi,
    I work with J2ME. I need to decode a binarie file and put the data in a byte[] to create after an image.
    My problem is that i have a negative values (sign) . And its impossible to create an image with that.
    Please can you tell me how can i do???
    Thanks
    Yaney

    Not quite sure what you want to do but
    i = 0-i;
    and
    i *= -1;
    will change the sign of i.

  • Problem with file length in jsp it is working in IE, not working Firefox

    Hi,
    I'm upload a file from the browser. i'm calculating the length i'm not getting the length of the file.
    The below shown code is working perfectly in IE and not working in Firefox.
    FileUpload.html
    <DOCTYPE>
    <HTML>
    <HEAD>
    <TITLE>Retailmint Jobs - Registration Form</TITLE>
    </HEAD>
    <BODY>
    <form>
    <table>
    <tr><td>Upload Resume :</td>
    <td> <input>
       </td>
    </tr>
    </table>
    <input>
    </p>
    <p>  </p>
    </form>
    </BODY>
    </HTML>
    FileUploadSubmit.jsp
    <page>
    <page>
    <page>
    <html>
    <head><title>Retailmint- Submission</title></head>
    <body>
    <FileInputStream>
    </body>
    </html>
    I find an error in firefox browser is not taking the fully qualified path
    i.e: C:\Documents and Settings\Administrator\Desktop\if.doc
    In firefox it is taking if.doc only.
    please tell me the solution.
    Regards
    venkat

    I agree with your words
    sorry for the code pasting.
    Here is the code:
    FileUpload.html
    <HTML>
    <HEAD>
    <TITLE>Retailmint Jobs - Registration Form</TITLE>
    </HEAD>
    <BODY>
    <form name='subregiform' method="get" action ="FileuploadSubmit.jsp" >
    <table width="566" border="0" cellspacing="0" cellpadding="0">
    <tr><td width="197"align="right">Upload Resume</td>
    <td width="369"> <input type="file" name="file" value ="" >
    </td>
    </tr>     
    </table>
    <input type="submit" name="submit" value="Submit">
    </form>
    </BODY>
    </HTML>
    FileUploadSubmit.jsp
    <%@ page import="java.text.*"%>
    <%@ page import="java.sql.*" %>
    <%@ page import="java.util.*" %>
    <%@ page import="java.io.*" %>
    <html>
    <head><title>Retailmint- Submission</title>
    </head>
    <body bgcolor="#e0e0e0">
    <%
    FileInputStream fis = new FileInputStream(request.getParameter("file"));
    len = (int)file.length();
    System.out.println("length"+len);
    %>
    </body>
    </html>
    And how to find the absolute path of a file in jsp or java
    Edited by: venkat.k on Sep 17, 2007 10:12 PM

  • Problem with httpservice.length

    Hi,
    I have written a httpservice which will return a dataset to
    me, now i am trying to loop that http service i have written the
    below code
    <mx:httpservice id="something" url="........default.aspx"
    />
    var i:int = 0
    for (i = 0;
    i<something.lastresult.newdataset.table.length; i++)
    if there is only one record in the httpservice then it is
    giving me the result as null and if there are 2 records if is
    displaying only 1 row
    can anybody find me a solution for this problem
    regards
    Rajeev

    You can find string length first. Subtract length by 4,  Then use like new = str+4(len), use condense if required.

  • Data Acquisition problem with multiple length of commands and data received.

    Hello,
    I need to write a program to communicate with a Data Acquisition board. There are about 10 commads and each has a different number of bytes associated with it. For example command-1 has 4 bytes which need to be send to the DAQ, command 2 has 6 bytes, Command 3 has 4 bytes etc...
    When the board responds back to the commands I send, it responds back with different number of bytes for each command. For example, When Command 1 is send to the board, it responds back with 3 bytes of data, whereas when command-2 is send it responds back with 5 bytes of data.
    Each data byte received by my labView program from the board, needs to be displayed after some processing has been done. This processing may or may not happen on all the bytes of data got back.
    I want the program to be scalable, so that if more commands are added later on, the display and the processing changes in accordance with that.
    What will be the best approach for such a system ? I want the system to be dynamic, and dont want to repeat or re-write the code for each case statement ( case statements will be decided by the commands).
    Any input is welcome.
    Thanks,
    birapxi

    Hello Dennis,
    That is certainly one way of doing it, but it is the brute force method. Is there any way to use clusters and add the data bytes coming in and going out to clusters. Also when the user sends a specific command out, can I use the unbundle by name function to send the bytes corresponding to that command.
    For displaying the data received, can I follow a similar approach and use unbundle by name function to just display the specific data bytes for the command i have received.
    Thanks for your input,
    birapxi

  • Problem with byte array arguments in webservice method call

    I am using JWSDP 1.5 to generate client stubs for a webservice hosted on a Windows 2000 platform.
    One of the methods of the webservice contains a byte array argument. When our application calls this method passing the contents of a TIFF file as the byte array, the method is failing. I have discovered that tthe reason for the failure is that the byte array in the SOAP message has been truncated and is missing its terminating tag.
    Is this a known problem in JWSDP 1.5? Is there a fix for it? Does JWSDP 1.6 resolve this problem?
    Any assistance will be much appreciated.
    Regards,
    Leo

    I'd like to add the the webservice being invoked by the generated client stubs is rpc/encoded.

  • Problem with Byte type

    Hi,
    Since JavaFX version 1.1 there were introduced some new data types (Byte, Short, etc.)
    I expected that they work in the similar way as in Java.
    But this is not true.
    I tried to assign a value that exceeds the range, with the following code
    var b : Byte = 128;
    and, as might be expected, I got compilation error.
    But when I tried:
    var b: Byte = -129;
    which exceeds the lower limit, there was no error or warning, and the value was overlapped giving in result 1. This is quite confusing.
    Could anybody explain if this is just a bug or intended behaviour.
    Thanks in advance, Lech
    PS. The same is with other integer types, but not with Integer!

    hi,
    would definitively file a bug at Jira-Kenai (if not already there).
    Seems to be solved in version 1.2.1 I tried:
    var by : Byte;
    by = -129 -> compile error + red line in NB 6.7.1
    by = -128 -> OK
    by = 127 -> OK
    by = 128 -> compile error + red line in NB 6.7.1 Although if I check the language specification the Byte and Short are not in the list of possible primitive types.
    But maybe the spec update has a bit delay ;-)
    Regards
    Guy

  • Problem with file length in jsp it is working in IE, not workig Firefox

    Hi,
    I'm upload a file from the browser. i'm calculating the length i'm not getting the length of the file.
    The below shown code is working perfectly in IE and not working in Firefox.
    FileUpload.html
    <DOCTYPE>
    <HTML>
    <HEAD>
    <TITLE>Retailmint Jobs - Registration Form</TITLE>
    </HEAD>
    <BODY>
    <form>
    <table>
    <tr><td>Upload Resume :</td>
    <td> <input>
       </td>
    </tr>
    </table>
    <input>
    </p>
    <p>  </p>
    </form>
    </BODY>
    </HTML>
    FileUploadSubmit.jsp
    <page>
    <page>
    <page>
    <html>
    <head><title>Retailmint- Submission</title></head>
    <body>
    <FileInputStream>
    </body>
    </html>
    I find an error in firefox browser is not taking the fully qualified path
    i.e: C:\Documents and Settings\Administrator\Desktop\if.doc
    In firefox it is taking if.doc only.
    please tell me the solution.
    Regards
    venkat

    Sorry for that
    here is the code:
    FileUpload.html
    <HTML>
    <HEAD>
    <TITLE>Retailmint Jobs - Registration Form</TITLE>
    <script language="Javascript" src="FileRead.js">
    </script>
    </HEAD>
    <BODY>
    <form name='subregiform' method="get" action ="FileuploadSubmit.jsp" >
    <table width="566" border="0" cellspacing="0" cellpadding="0">
    <tr><td width="197"align="right">Upload Resume :</td>
    <td width="369"> <input type="file" name="file" value ="" onchange ="javascript:fopen('file');"><br>
       </td>
    </tr>     
    </table><br>
    <input type="submit" name="submit" value="Submit">
    </strong></p>
    <p>  </p>
    </form>
    </BODY>
    </HTML>
    FileUploadSubmit.jsp
    <%@ page import="java.text.*"%>
    <%@ page import="java.sql.*" %>
    <%@ page import="java.util.*" %>
    <%@ page import="java.io.*" %>
    <jsp:useBean id="DBase" class="dbconnection.DBconnection" scope="session" />
    <html>
    <head><title>Retailmint- Submission</title>
    </head>
    <body bgcolor="#e0e0e0">
    <%
    FileInputStream fis = new FileInputStream(request.getParameter("file"));
    len = (int)file.length();
                   System.out.println("length"+len);
    %>
    </body>
    </html>
    And tell me How to find the absolute path of a file in JSP or JAVA?

  • Problem with file length in jsp IE it is working Firefox it is not workig

    Hi,
    I'm upload a file from the browser. i'm calculating the length i'm not getting the length of the file.
    The below shown code is working perfectly in IE and not working in Firefox.
    FileUpload.html
    <DOCTYPE>
    <HTML>
    <HEAD>
    <TITLE>Retailmint Jobs - Registration Form</TITLE>
    </HEAD>
    <BODY>
    <form>
    <table>
    <tr><td>Upload Resume :</td>
    <td> <input>
       </td>
    </tr>
    </table>
    <input>
    </p>
    <p>  </p>
    </form>
    </BODY>
    </HTML>
    FileUploadSubmit.jsp
    <page>
    <page>
    <page>
    <html>
    <head><title>Retailmint- Submission</title></head>
    <body>
    <FileInputStream>
    </body>
    </html>
    I find an error in firefox browser is not taking the fully qualified path
    i.e: C:\Documents and Settings\Administrator\Desktop\if.doc
    In firefox it is taking if.doc only.
    please tell me the solution.
    Regards
    venkat

    Sorry for that
    here is the code:
    FileUpload.html
    <HTML>
    <HEAD>
    <TITLE>Retailmint Jobs - Registration Form</TITLE>
    <script language="Javascript" src="FileRead.js">
    </script>
    </HEAD>
    <BODY>
    <form name='subregiform' method="get" action ="FileuploadSubmit.jsp" >
    <table width="566" border="0" cellspacing="0" cellpadding="0">
    <tr><td width="197"align="right">Upload Resume :</td>
    <td width="369"> <input type="file" name="file" value ="" onchange ="javascript:fopen('file');"><br>
       </td>
    </tr>     
    </table><br>
    <input type="submit" name="submit" value="Submit">
    </strong></p>
    <p>  </p>
    </form>
    </BODY>
    </HTML>
    FileUploadSubmit.jsp
    <%@ page import="java.text.*"%>
    <%@ page import="java.sql.*" %>
    <%@ page import="java.util.*" %>
    <%@ page import="java.io.*" %>
    <jsp:useBean id="DBase" class="dbconnection.DBconnection" scope="session" />
    <html>
    <head><title>Retailmint- Submission</title>
    </head>
    <body bgcolor="#e0e0e0">
    <%
    FileInputStream fis = new FileInputStream(request.getParameter("file"));
    len = (int)file.length();
                   System.out.println("length"+len);
    %>
    </body>
    </html>
    And tell me How to find the absolute path of a file in JSP or JAVA?

Maybe you are looking for