How to encode primitive type  in JAVA

who can give me some documents that clarify how to encode primitve type ,or directly clarify in your words. thanks!

the rule is : 1 is encoded in binary string :
0000 0000 0000 0000 0000 0000 0000 0001
-1 is encoded in binary string:
1111 1111 1111 1111 1111 1111 1111 1111

Similar Messages

  • How to check browser type using java.

    Hi,
    can anybody help me to check browser type using java.
    Weather it is IE or Mozilla or Opera .
    any class in java for such operation?
    vjoy

    can anybody help me to check browser type using
    java.
    Weather it is IE or Mozilla or Opera .
    any class in java for such operation?From where do you want to perform the check? An applet, application or web application?
    Kaj

  • How do you underline type in java

    I am new to java and I can't seem to find a way to make type underline in a applet. do I add something to the g.string or is there a int. I need to use?

    Java does not support underlining as a font property. In order to do this properly, you need to look at the Java 2D text capabilities, esp. the TextLayout and related classes.
    Mitch Goldstein
    Author, Hardcore JFC (Cambridge Univ Press)
    [email protected]

  • How to Change Paper Type Using Java script

    HI ,
    We have a requirement , in which we have to change the paper type i.e. "A2" , "A3","A4" etc.  while printing using a JavaScript. I have written a code like this :
    xfa.form.form1.pageSet.Page1.medium.stock = "A2"; But this is not working. please help me out.
    Thanks,
    Bhaskar.

    That's the right object for choosing the page size at Design time. What event are you doing this on? Although you can change it in the form model, the form's page size is already determined from the template by the time you have a form to script against, so although you can change it via script after the fact in XFA, I don't believe it will have any impact. Even putting it on the layout ready event does not work.

  • How to change font type in java mail script?

    Hi,
    I wrote a bean shell script to send mail on particular event. I want mail message body text font style to be modified.
    Please provide help on this.
    Thanks,
    Saloni

    Hi Saloni ,
    You can add the text in the following way by using font tags for message body in your custom mail.
    Message msg = new MimeMessage(session);
    MimeMultipart mp = new MimeMultipart();
    MimeBodyPart mbp1= new MimeBodyPart();
    String htmlText = "<b> This is formatted</b>"+
    "<font size =\"5\" face=\"arial\" >This paragraph is in Arial, size 5</font>";
    mbp1.setContent(htmlText,"text/html");
    mp.addBodyPart(mbp1);
    msg.setContent(mp);
    It worked for me. Let me know if you face any issue.
    Regards,
    Uday.

  • Selecting #of bits for data types in Java

    hi,
    i would like to know if we can constrain compiler on allocating memory to basic data types, such as int, float, short etc. i would like to read an exactly four byte integer into an int, 2 byte short into a short etc. i need to read these parameters exactly of their specified number of bytes - not more or less - as if i read anything more/less, i will be reading a part of other parameter.
    i know that C allows us to do this by letting us to specify number of bits we like to allocate for each data type (for eg. unsigned int:16; means i need an unsigned int of exactly 16bits (2 bytes long) -no more and no less).
    Is there anything similar i can do in Java?
    any suggestion is greately appreciated.
    Thanks,

    All primitive types in Java are well-defined. In contrast to C/C++, an int in Java is allways 32 bits, using one's complement, a char is allways 16 bits etc.
    Java does not give you direct acces to physical memory - that would compromise the basic design of Java.
    You can read individual bytes from files, and you can do all the integer arithmetic in Java as you can in C/C++. To convert eg. fout bytes to one int, you could do the following:
    byte b1= (some byte value),
         b2,
         b3,
         b4;
    int i= (((b1 << 8) | b2 << 8) | b3 << 8) | b4;
    b1 being the most significant byte, b4 being the least significant.
    Did this answer you questions?

  • Primitive type Changing???

    One of my friends sent me this e-mail. Can anyone help??
    ok wood, here's one for you:
    the software i'm writing get's data from one of two processors on a
    satelite. these processors use different #'s of bytes for their
    primitive types.
    bool - 1 byte
    short - 2 bytes
    int - 2 bytes
    long - 4 bytes
    float - 4 bytes.
    so..as you know the jvm uses 4 bytes for an int, 8 for a long. I
    want to be able to have people who are developing sims ontop of my
    framework be able to use a primitiave type, such as an int, and have
    it only be 2 bytes...now i'm pretty sure this isn't possible. You
    can't overload a primitive type in java right? I have some ideas
    here on what to do (create whole new objects, holding byte arrays and
    use java.nio to manaage them), but it just seems like such a hastel.
    i guess i was wondering if you have ever seen this kindof thing
    before and if you had any advice. thanks man.

    In C, primitive types can vary in size, based on the platform being used. In Java, the size of primitives is static. If he wants 16-bit storage, short is the way to go. Well, a char is a couple of bytes, too, but it's unsigned, intended for Unicode characters, and probably not what he's looking for anyway...
    :o)

  • How to read XI Data type in Java code and populate as array list, using UDF

    Hi,
    How to read XI Data type in Java code and populate as array list, using UDF?
    Is there any API using which  the XI data types can be read?
    Kindly reply.
    Richa

    Input Structure:
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:CustomerCreateResp xmlns:ns0="urn:bp:xi:up:re:cust_mdm:cmdm:pr5:100">
       <CUSTOMER>
          <item>
             <CUSTOMERNO/>
             <MDMCUSTOMER/>
             <CREATE_DATE/>
             <RETURN>
                <TYPE/>
                <MESSAGE/>
             </RETURN>
             <PT_CONTPART_RETURN>
                <item>
                   <MDM_CONTACT/>
                   <CONTACT/>
                </item>
             </PT_CONTPART_RETURN>
             <PARTNERS>
                <item>
                   <CUSTOMERNO/>
                   <PARTNER_FUNCTION/>
                   <PARTNER_NUMBER/>
                   <DEFAULT_PARTNER/>
                </item>
             </PARTNERS>
          </item>
       </CUSTOMER>
    </ns0:CustomerCreateResp>
    Output structure
    (Sample output structure.This actually needs to be mapped and generated using UDF)
    <?xml version="1.0" encoding="UTF-8"?>
    <ns1:updateCustomer xmlns:ns1="urn:xiSericeVi"><ns1:customer><ns2:ArrayList xmlns:ns2="java:sap/standard">[]</ns2:ArrayList></ns1:customer><ns1:name>2344566</ns1:name></ns1:updateCustomer>

  • How to get the values from struct data type using java code..?

    Hi ,
    I am newer to java.
    we are using oracle database.
    How to get the data from struct data type using java code.
    Thanks in Advance.
    Regards,
    kumar

    Hi Rajeev,
    To retrieve a FilterContainer you will need to traverse the report structure:
    ReportStructure boReportStructure = boDocumentInstance.getStructure();
    ReportContainer boReportContainer = (ReportContainer) boReportStructure.getReportElement(0);
    FilterContainer boFilterContainer = null;
    if (boReportContainer.hasFilter()) {
         boFilterContainer = boReportContainer.getFilter();
    } else {
         boFilterContainer = boReportContainer.createFilter(LogicalOperator.AND);
    Calling boDocumentInstance.getStructure() will retrieve the entire structure for the document.
    Calling boReportStructure.getReportElement(0) will retrieve the structure for the first report of the document.
    Hope this helps.
    Regards,
    Dan

  • How to determine IE type(32 bit or 64 bit) in a task sequence while updating Java

    How to determine IE type(32 bit or 64 bit) in a task sequence
    Hi,
    Currently i have to update new version of Java after removing all the previous existing version of Java by using TS in SCCM 2007.
    we have both 32 bit and 64 bit browser in the environment. I am stucked in determining whether the browser is of 32 bit or 64 bit.
    How to determine IE type(32 bit or 64 bit) in a task sequence so that respective java can be installed for that IE browser.
    will highly appreciate quick response.
    Thanks in advance.
    Daya

    But you also need to install JRE x86 on x64 systems, since most people actually use the 32bit browsers on x64 systems.
    The detection logic is actually pretty simple -- just check the right registry hive to find the installation location of the BIN\JAVA.DLL. Both pathnames are stored in HKLM\Software\JavaSoft\Java Runtime Environment\1.7 in the registry value "JavaHome",
    but the x86 path is stored in the 32-bit hive and the x64 path is stored in the 64-bit hive.
    Lawrence Garvin, M.S., MCSA, MCITP:EA, MCDBA
    SolarWinds Head Geek
    Microsoft MVP - Software Packaging, Deployment & Servicing (2005-2014)
    My MVP Profile: http://mvp.microsoft.com/en-us/mvp/Lawrence%20R%20Garvin-32101
    http://www.solarwinds.com/gotmicrosoft
    The views expressed on this post are mine and do not necessarily reflect the views of SolarWinds.

  • Java primitive types??

    What r the Java primitive types??What is it for?

    What exam or job interview are you studying for exactly? One day it's strange questions on EJB, an another JSF, on another some question about Servlets demonstrating a lack of fundamental understanding of web services and today primitives?
    Please give due consideration to actually learning Java properly and not just random bits and pieces. Your current style is not working for you as can be seen from the constant utter confusion of many of your questions and posts.

  • How would you store a primitive type?

    Hello
    How would you store a primitive type in a Collection such as a List?
    Thanks
    Bobby

    <face grin=evil> myList.add(int.class); </face>

  • Reference to primitive types?

    I want to write a GUI that is able to set parameters to classes without knowing the exact nature of parameters. The parameter types are restricted to int and String. Something like this:
    ...in GUI class:
    ClassToConfigure c = getFromSomewhere();
    for (int i=0; i<c.getPropertyCount(); i++) {
      addToGUI(c.getDescription(), c.getType(), c.getKeyName())
    then later after the value is set in the GUI:
    c.setProperty(keyName, newValue);the setProperty method would have implementations for each type of newValue, and the GUI would have editing capabilities for each type too.
    My problem is that I do not know how to implement this in the ClassToConfigure (CTC). My thoughts were: CTC enumerates all field it wants to be configurable in its constructor, something like:
    addProperty(actual_field, "int", "Some description", "UniqueName");the CTC class would have a list of all properties with the "references" to the actual field to be able to update them.
    but then I don't know how to update the fields when CTC.setProperty() is called. Is there a way to keep a reference to a field, even if the field has a primitive type? Another way to do it would be using function pointers, passing the getter and setter to CTC.addProperty, but this isn't possible in java.
    Is there any straightforward way of implementing such behavior in java without tricky use of reflection?
    Thanks in advance,
    -Lev
    P.S. I hope I made my point understandable, if not please let me know and I'll try to rephrase my concern.

    I did not understand what you meant. But you can have the OO equivalents to function pointers, and that is method references. (But that is part of the the java.lang.reflect package)
    Kaj

  • Configure array of primitive type for POF

    My impression is that Coherence's POF implementation can handle Java primitive and String by default thus we don't need to provide a customized POF configuration file if the object been put into the cache is Java primitive type.
    How about arrary of primitive type? For example, byte[]. Can Coherence's POF implementation handle byte[] as well?

    Just asking since we plan to move from using Externalizable to POF and not sure if we need special handling for byte[] type.
    Thanks for the reply.
    Regards,
    Chen

  • Axis webservice, wsdl and primitif type

    Environnement :
    JDK1.6, axis2-1.3, tomcat-6
    i have a POJO service called ProjectService wich return a ProjectVO value object, this object contains an item "themeId" of type Long (object not primitif type), because this item can be null.
    I use the eclipse wizard (bottom-up methode) to generate the Webservice, i ended with "server side" code, and "client side" code (stub.....) the stub obtained is called ProjectServiceStub wich contains an inner class ProjectVO, but this time
    the getThemeId() return a long primitif type and not a Long object.
    in the other side the eclipse-axis wizard generate a wsdl, the piece of information regarding themeId, is as follwoing
    <xs:element minOccurs="0" name="themeId" nillable="true" type="xs:long"/>
    ...the probleme is, when the POJO service return a NULL for the themeId item, the Webservice return a negatif big number, because int the ProjectServiceStub.ProjectVO object, the themeId is long and not Long.
    how can i fixe this probleme
    thanks for your help

    That wasnt really the question.
    Obviously Ive read the tutorial.
    Built my own DII client and webservice.
    Now im asking questions not covered by the tutorial.
    The question was how to reference complex java types.
    What are all the different types that can be included in a WSDL document. So far ive used String, Boolean. what else. Surely there must be a document that points these out!
    The answer to the other part of the question was quite simple.
    In the WSDL document, if a method takes multiple input paramters, the WSDL lists them by number.
    ie string 1, string 2 ect. as shown in previous listing.
    call.addParameter("String_1", QNAME_TYPE_STRING,
    ParameterMode.IN);
    So here you just add the additional parameters changing string 1 for the required parameter.

Maybe you are looking for

  • How to get input stream of other application

    Using Java is their any way to get the input stream of another applicaton?. For example i will start a java program and minimize it. Then i will start a notepad and type some thing in it. Java program should print all matters i am typed in notepad. I

  • New ipod nano (6th gen) cannot be identified

    New ipod nano 6th gen replacement for a broken one and when plugged in a message says "An ipod has been detected but cannot be identified properly". How do you connect a new iod to an old playlist?

  • Calling ringtones from the application

    Hi guys. I am searching about to getting ring tones of iPhone for application. In other words, user can choose ringtone from iPhone Ringtone list. In order to do that, what do I need to use what class ? Do you have an example related this issue ? Ple

  • Bound properties listeners sources javabeans

    Hi all I am working on an assignment for college, trying to learn Java etc, Basically I need one object to react to events in another Code is as follows // Extra Panel package myPackage1; import java.awt.GridLayout; import java.beans.PropertyChangeEv

  • I lost my ipod, and it had died. I found it and now it wont charge. how do i fix it?

    so my ipod died, and i didnt have a charger for it. and then i lost it.  but i just refound itt, and tried plugging it in to charge and it wont. Its brand new, no scratches or anything, and it wont charge. i have a brand new cable and everything but