C + c++ / Java POFReader inconsistancies

I noticed that POFReader/POFWriter in Java interfaces have a few methods which have no equivalents on the c ++ API:

writeBigDecimal
writeBigInteger
writing data
writeDateTime
writeDateTimeWithZone
writeRawQuad
writeTime
writeTimeWIthZone

If there is a POF object in the cache that has been serialized by java application by using these methods, it is possible for me to deserialize it into a c++ application? If so, how?

See you soon,.
Paul

Paul-

I ran this by a member of the team of coherence more and:

BigDecimal, BigInteger and RawQuad are not supported because there is no corresponding standard C++ type to map to.
(There is a COH-2696 demand to ensure a certain level of support for these types)

Date/time variants are being supported by the classes coherence::io:pof:Raw *.
(http://download.oracle.com/otn_hosted_doc/coherence/353CPP/namespacecoherence_1_1io_1_1pof.html)

Fields of these types, in shared in Java/C++, objects will be not accessible from C++.

/ Mark

Tags: Fusion Middleware

Similar Questions

  • Performance consistency POF vs Java Seriailization...

    Hello
    I tried to compare the performance of Java vs consistency POF serialization so I wrote some examples of classes in order to compare the time taken to serialize and the size of the byte array created to contain the serialized bits. I found that the simple objects Java serialization has given the better results than the POF. I write the code online. Can you get it someone please let me know if the comments are correct or if a different approach should be taken for POF serialization?

    Thank you.
    Raphy


    These are the statistics kept for 1000 serialization of objects...

    time to serialize an object in nano seconds 9744954 Java

    time for pof serialization of an object in nano seconds 64662544

    Total time required for java serialization of objects 1000 in nano seconds 57661927

    Total time required for pof serialization of objects 1000 in nano seconds 90891948

    Size of table of the total number of bytes for java serialization is 403890
    Size of table of the total number of bytes for the serialization of pof is 1029000

    The code is pasted below...

    serializable Java object
    package com.apx.core.test.serialization;

    import java.io.Serializable;
    import java.util.Date;

    / public class JavaSerializable implements Serializable {}

    private String name;
    Field1 double private;
    Field2 long private;
    field3 Double private;
    Field4 Long private;
    private Date dateField;

    public String getName() {}
    return the name.
    }
    public void setName (String name) {}
    myIdName = name;
    }
    {} public double getField1()
    return of field1;
    }
    public void setField1 (double Field1) {}
    This.Field1 = field1;
    }
    {} public long getField2()
    return Field2;
    }
    public void setField2 (long Field2) {}
    This.Field2 = Field2;
    }
    {} public Double getField3()
    return of field3;
    }
    public void setField3 (Double field3) {}
    This.field3 = field3;
    }
    {} public Long getField4()
    return of field4;
    }
    public void setField4 (Long field4) {}
    This.Field4 = field4;
    }
    public Date getDateField() {}
    return dateField;
    }
    {} public void setDateField (Date dateField)
    this.dateField = dateField;
    }

    }

    Object serializable POF
    package com.apx.core.test.serialization;

    import java.io.IOException;
    import java.util.Date;

    import com.tangosol.io.pof.PofReader;
    import com.tangosol.io.pof.PofWriter;
    import com.tangosol.io.pof.PortableObject;

    / public class POFSerializable implements PortableObject {}
    public static final int TYPE_ID = 100;

    private String name;
    Field1 double private;
    Field2 long private;
    field3 Double private;
    Field4 Long private;
    private Date dateField;

    public String getName() {}
    return the name.
    }
    public void setName (String name) {}
    myIdName = name;
    }
    {} public double getField1()
    return of field1;
    }
    public void setField1 (double Field1) {}
    This.Field1 = field1;
    }
    {} public long getField2()
    return Field2;
    }
    public void setField2 (long Field2) {}
    This.Field2 = Field2;
    }
    {} public Double getField3()
    return of field3;
    }
    public void setField3 (Double field3) {}
    This.field3 = field3;
    }
    {} public Long getField4()
    return of field4;
    }
    public void setField4 (Long field4) {}
    This.Field4 = field4;
    }
    public Date getDateField() {}
    return dateField;
    }
    {} public void setDateField (Date dateField)
    this.dateField = dateField;
    }


    @Override
    public String toString() {}
    Return "POFSerializable [dateField =" dateField + ', Field1 =' + field1
    + ', Field2 =' + Field2 + ', field3 =' + field3 + ', field4 ='
    field4 + ', name =' + name + '] ';
    }

    @Override
    Public Sub readExternal (PofReader arg0) throws IOException {}
    myIdName = arg0.readString (0);
    This.Field1 = arg0.readDouble (1);
    This.Field2 = arg0.readLong (2);
    This.field3 = arg0.readDouble (3);
    This.Field4 = arg0.readLong (4);
    this.dateField = arg0.readDate (5);


    }

    @Override
    Public Sub writeExternal (PofWriter arg0) throws IOException {}
    arg0. WriteString (0, myIdName);
    arg0.writeDouble (1, this.field1);
    arg0.writeLong (2, this.field2);
    arg0.writeDouble (3, this.field3);
    arg0.writeLong (4, this.field4);
    arg0.writeDate (5, this.dateField);

    }

    }

    The tester of serialization class
    package com.apx.core.test.serialization;

    import java.io.ByteArrayOutputStream.
    import java.io.IOException;
    import java.io.ObjectOutputStream;
    import java.util.ArrayList;
    import java.util.Date;
    import java.util.List;

    import com.tangosol.io.ByteArrayReadBuffer;
    import com.tangosol.io.ByteArrayWriteBuffer;
    import com.tangosol.io.ReadBuffer.BufferInput;
    import com.tangosol.io.WriteBuffer.BufferOutput;
    import com.tangosol.io.pof.PortableObjectSerializer;
    import com.tangosol.io.pof.SimplePofContext;

    public class SerializationTester {}
    Private Shared SimplePofContext pofContext = new SimplePofContext();

    {public static
    pofContext.registerUserType (POFSerializable.TYPE_ID, POFSerializable.class,
    new PortableObjectSerializer (POFSerializable.TYPE_ID));

    }

    private list < JavaSerializable > javaSerialList = new ArrayList < JavaSerializable > ();
    private list < POFSerializable > pofSerialList = new ArrayList < POFSerializable > ();

    Public Shared Sub pofSerializeObject (exit BufferOutput, Object o) throws IOException
    {
    pofContext.serialize (output, o);
    }

    public static Object deserializePofObject (in BufferInput) throws IOException
    {
    Return (in) pofContext.deserialize;
    }

    public SerializationTester() {}

    for (int i = 0; i < 1000; ++ i)
    {
    Serializable JavaSerializable = new JavaSerializable();
    POFSerializable pofSerializable = new POFSerializable();
    javaSerialList.add (serializable);
    pofSerialList.add (pofSerializable);
    initialize the java serializable objects...
    serializable.setName ("Name" + i);
    serializable.setField1 (Double.MAX_VALUE);
    serializable.setField2 (Long.MAX_VALUE);
    serializable.setField3 (Double.MAX_VALUE);
    serializable.setField4 (Long.MAX_VALUE);
    serializable.setDateField (new Date());

    initialize the POF serializable objects...
    pofSerializable.setName ("Name" + i);
    pofSerializable.setField1 (Double.MAX_VALUE);
    pofSerializable.setField2 (Long.MAX_VALUE);
    pofSerializable.setField3 (Double.MAX_VALUE);
    pofSerializable.setField4 (Long.MAX_VALUE);
    pofSerializable.setDateField (new Date());
    }

    }

    Public Sub getJavaSerializationStats() throws Exception
    {
    List of < byte [] > objectSizes = new ArrayList < byte [] > ();
    long totalTime = 0;

    int count = 0;
    for (instance of JavaSerializable: javaSerialList)
    {

    long beginTime = System.nanoTime ();
    Byte [] objectBits = serializeObject (instance);
    long finishTime = System.nanoTime ();
    totalTime += (finishTime - beginTime);
    objectSizes.add (objectBits);
    if(Count==0)
    {
    System.out.println ("time to serialize an object in nano seconds of java" + (finishTime - beginTime));
    }
    ++ count;
    }
    System.out.println ("Time taken to java serialization of objects 1000 in nano seconds Total" + (totalTime));
    totalLength length = 0;
    for (byte [] bs: objectSizes) {}
    totalLength += bs.length;
    }
    System.out.println ("size of table of the Total number of bytes for a serialization java is" + totalLength);
    }

    Public Sub getPOFSerializationStats() throws IOException
    {
    List of < byte [] > objectSizes = new ArrayList < byte [] > ();
    long totalTime = 0;

    int count = 0;
    BufferWriter ByteArrayWriteBuffer = new ByteArrayWriteBuffer (1);
    for (instance of POFSerializable: pofSerialList)
    {

    long beginTime = System.nanoTime ();
    pofSerializeObject (bufferWriter.getBufferOutput (), for example);
    long finishTime = System.nanoTime ();
    totalTime += (finishTime - beginTime);

    objectSizes.add (bufferWriter.getRawByteArray ());

    if(Count==0)
    {
    System.out.println ("TimeFor pof serialization of an object in nano seconds" + (finishTime - beginTime));
    }
    ++ count;
    }

    System.out.println ("Time taken to pof serialization of objects 1000 in nano seconds Total" + (totalTime));
    now read the objects to return...
    totalLength length = 0;
    for (byte [] bs: objectSizes) {}

    totalLength += bs.length;
    ByteArrayReadBuffer readBuffer = new ByteArrayReadBuffer (bs);
    Object obj = deserializePofObject (readBuffer.getBufferInput ());
    System.out.println (obj);
    }
    System.out.println ("table size to the Total number of bytes for the serialization of pof is" + totalLength);
    }

    Public Shared Sub main (String [] args) throws exceptions
    {
    Tester SerializationTester = new SerializationTester();
    tester.getJavaSerializationStats ();
    tester.getPOFSerializationStats ();

    }

    private byte [] serializeObject (Object, object) {}
    try {}
    ByteArrayOutputStream Bos = new ByteArrayOutputStream();
    ObjectOutputStream out = new ObjectOutputStream (bos);
    out.writeObject (object);
    out. Close();

    message from Byte [] = bos.toByteArray ();
    return the message;
    } catch (IOException e) {}
    throw new RuntimeException (e);
    }
    }


    }

    Published by: user10928746 on March 23, 2009 15:33

    Hi Raphy,

    You should not use the getRawByteArray method, first because it is private to the buffer, secondly because it returns an array that is greater than the actually used amount of bytes. Similar in internal table of a StringBuffer, while toByteArray is similar to a new string with a correct internal character array returned by the toString method of the StringBuffer.

    Instead, you must use the toByteArray method which returns an array of bytes which is only as long as necessary, so the length is correct.

    In addition, I would take your time with a grain of salt values you POF serialization at an unfair disadvantage because it always starts with a byte of an array, and must reassign, possibly several times. Coherence itself collects the stats of the objects it serializes and pré-alloue a buffer that is probably wide enough so that no reallocation will be necessary.

    Also, you collect a large memory footprint by running your code in a loop and maintaining arrays of bytes that could lead to global catalogs that may influence the outcome of your time, more clearly that you have more objects, and part of your test POF has more objects because all Java serialized objects are always kept in a Member If your test is again a bias against the POF.

    Best regards

    Robert

  • Need to install Java command line tool

    I get this error after the installation of the new OS sierra. Java is up to date. How can I fix it?  Thank you.

    The most likely cause is the program that wants to use Java's only request the use of Apple legacy Java 6. That the developers didn't like enough to have use Java the right way, you need to install Apple legacy Java 6 or uninstall the program that wants to use Java - likely produced Adobe or a Facebook video chat program.

    Download Java for OS X 2015-001

    Maybe it's that the program requires a JDK be installed instead the JRE from Java.com. So, if you download the SDK Java Oracle of Oracle's Web site, then you might try that if you have a recent version of Java. However, I don't think I've seen someone declare that as successful as the program who need Java so poorly designed.

  • Error Java Run After downloading the new Sierra

    Java is up to date and I get this error message. A couple of times, I have "updated" restarted. Still happens.

    Hi cjshrad,

    Thank you for contributing to the communities of Apple Support. I see in your message you receive a Java error after upgrade to Sierra on your Mac. I'd be happy to help with this!

    First of all, try to install the Java for OS X package found here:

    Download Java for OS X 2015-001

    The next step, if you still see this error, I recommend that you completely uninstall Java from your Mac by following the steps listed here:

    How to uninstall Java on my Mac?

    Once you're done, use this link to download and install the latest version of Java for your Mac:
    Download Java for your Mac - Apple Support

    Take care!

  • Remove Java and Flash Player?

    I asked here how to install Java and Flash Player, and I think I did, but I'm not sure I have remove 100%. Is there a way I can see if they are deleted?

    For Java, open Termonal paste this back in & hit...

    Java-version

    For Flash...

    http://isflashinstalled.com

  • How can I remove Flash Player and Java.

    I heard recently that Java and Flash Player are unnecessary and dangerous to have on your mac. I can't understand how to remove however.

    Someone told me to go to this link, is it reliable? (this is not a https that is why I asked.)

    http://Java.com/en/download/help/mac_uninstall_java.XML

    Download uninstaller for Adobe.

    You can find it https://helpx.adobe.com/flash-player/kb/uninstall-flash -Player-mac - os.html? sdid = 952G4XMS & skim803X112722X93c5ed8aaad2bcfb...

    There is a different version depending on the age of your operating system.

    Start the uninstall program of your download on your Mac folder.

    When the uninstall program runs, click on uninstall

    Enter your admin password and close all your browsers.

    Uninstall is complete it is also wise to delete the two folders, according to Adobe. These appear in the library of the House of the directory folder. Go to Finder, click on reach in the menu and press Alt (or Option) to present the case of the library as a menu drop-down. Look for these two folders and delete them:

    ~/Library/Preferences/Macromedia/Flash\ Player

    ~/Library/caches/Adobe/Flash\ Player

  • How to uninstall Java

    I installed java about two years ago on my iMac, but I recently heard here that Java is not very safe to have so I want to remove it but I can't seem to find a way too. How to remove it?

    Please read http://java.com/en/download/help/mac_uninstall_java.xml

    Plugin Web Please read How to disable the Java plugin Safari - Apple Support web.

  • Nag boring to install Java

    I upgraded to Sierra last night.  Now I get a persistent nag to install Java runtime.  I don't want to install it.  How can I get rid of the nag?

    Determine the program that you use that requires Java. I suggest reviewing your login items, perhaps.

  • How to see if there are Java in my Mac?

    Hello!

    I saw this article.

    https://www.Intego.com/Mac-Security-blog/adwind-rat-malware-everything-you-need-de know.

    Basically, as long as I don't have Java, I have nothing to fear? I've read that recent Macs lack Java (thanks, Apple!), but is there a way to check if there is no Java at all? It would be easier.

    I checked the preferences system and if there is Java autour, there should be this symbol of Cup of steaming tea somewhere in the level below the system of preferences?

    I want to just make sure that I don't really have these Java garbage.

    https://techhelpkb.com/find-Java-version-in-Mac/

  • What is the safest version of Java?

    One of my Mac is currently using a depreciated version of Java 6 with access by browser off. I be sure? Version 7 and 8 provided by java to be safer?

    The most common that is a version of Java, it is the safest. That said, however, there are some applications that do not work with versions of Oracle as some Adobe products. Apple Java 6 has had security updates in order to continue to use it if you wish.

  • Java SDK (new) dialog box

    Hello my fellow partners Mac!

    This seems to be a common problem, whenever we have a new version of Mac OS, but I can't, from my POV, find the right solution.

    Every two hours or when waking from sleep, a dialog box appears telling me to install a Java Development Kit. As I said, this has happened many times before when you Google, but I can't find someone who offers you a solution where you don't need to install the JDK. It seems that the only solution is to succumb to the demand of the dialog box.

    In my case (and this may vary, I'm not sure), it is the launchd process that requires it. But I can't go further than in my knowledge of the OS. I tried to delete all the files about kinds of Java and have looked everywhere for stuff that could trigger this, I deleted LauchDeamons, LaunchAgents, all related to Java I could remove in / System / * and (~)/Library/* etcetera, etcetera, but this dialog box keeps popping up, so something ask and I cannot understand what it is.)

    What I need, is not install Java. I don't like, and I think that it is an old and dangerous technology. I want to just get rid of it all once and for all (and if all goes well, without having to reinstall everything form scratch).

    Anyone can shed some light on this? It's the system itself that think I need this, or is there a way I can dig deeper to understand what triggers it?

    See you soon,.

    Massimo

    What I need, is not install Java. I don't like, and I think that it is an old and dangerous technology. I want to just get rid of it all once and for all (and if all goes well, without having to reinstall everything form scratch).

    Anyone can shed some light on this? It's the system itself that think I need this, or is there a way I can dig deeper to understand what triggers it?

    The operating system does not use Java in some way. You have installed software that only requires Java, but it must also be Java 6 legacy published by Apple (and abandoned) years.

    If you don't want to install Java, you must determine what software you have installed which requires Java and remove it. From what I've seen here, it's generally Adobe software that appears to have been poorly coded to only use the Apple of Java 6.

  • Issues of Java in the Sierra

    I recently installed OS Sierra and get the pop-up message, "to use the"Java"command line tool, you must install a JDK".  I installed the program several times via the link provided and rebooted my computer to restart.  The message continues to be displayed.  How to solve this problem?

    Did you install Apple legacy Java 6 or Oracle? Only the legacy Java 6 will solve the problem before the uninstall of the software that requires Java 6 legacy rather than any other version.

    Download Java for OS X 2015-001

  • macOS Sierra with Java.

    Remote access for my business relies on Java, I sign in my remote desktop I get an internal error MFC in Java. Worked fine before upgrading the operating system. Any ideas?

    What your service COMPUTER told you?

  • Where can I find 6 of Java SE Runtime - needed to run older Adobe software?

    Where can I find and install Java 6 SE Runtime - necessary for the performance of the older Adobe software? Thank you!

    Hi thinkman12345,

    I understand that you want to download an older version of Java runtime SE. No worries! You can find archived versions of Java on their Web page. Try to look at this link:

    Download Java for OS X 2015-001

    Should you get the Java version required to run this older Adobe software. Please use the Apple Support communities to post your question.

    Good day.

  • MacOS Sierra Safari dangerous running Java no longer works

    Now it is a big problem here... I used to download files for production on a platform inside using java with dangerous option, it's the only way, now, after the Sierra of MacOS, the options are only on/Off/Ask and not more dangerous then... *... impossible to send production files more cause of this problem, even aid is not being updated, the instructions for the difficulty of saying to use the dangerous which are no longer there in safari configurations for Java.

    Thank you! You make me feel so much better that I am also having a problem like that!

    No non-secure mode available for Java/UPS.com thermal printer

    Here's hoping that someone can help, because I told my assistant to customer Apple once again, and he could not help me. I have ordered another HARD disk and to restore to my last backup TM.

Maybe you are looking for

  • How can I copy a line or paragraph of text in an email to a Works document

    I need to copy multiple lines of text of the email (AOL) in my WORKS documents. -NOT the entire email, only a few lines.

  • Printer all-in-one Officejet 5510v

    My HP Officejet 5510v all-in-one printer fails to print from my computer, with an error message indicating that there is a jam. I tried to delete but cannot find any paper jam or carriage jam. I can scan, copy without problem. I can not even go to th

  • Star Trek Armada II are not enough memory error

    Original title: program compatibility Application Applications Apps game games Legacy Crash accidents Application Hang hangs Have any probs with Star Trek Armada II Windows 7 not said enough witch memory of Corsica is not true. any help?

  • Smartphone Voicemail on my Torch 9800 blackBerry problem

    I had my 9800 Torch for over a year, and he stopped just to recognize my password for voicemail.  I followed the instructions to try to reset it, but got the same result.  Help, please. Thanks SW

  • Restore UEFL/BIOS dualboot to newly reinstalled Win8

    Hi all I use an Acer Windows laptop and just reinstall windows. the laptop was able to fashion dual boot UEFL/BIOS but after reinstalling (biOS mode inherited), the initialization of the UEFL is lost. In the windows advanced boot menu, setting UEFL h