Why use read. A long time to read the date type in the following code?

Why use the read. Long to read the type of date in the following code?
Thank you
public void readExternal(PofReader reader)
throws IOException
{
setFirstName(reader.readString(0));
setLastName(reader.readString(1));
setHomeAddress((Address) reader.readObject(2));
setWorkAddress((Address) reader.readObject(3));
setTelephoneNumbers(reader.readMap(4, null));
setBirthDate(new Date(reader.readLong(5)));
}
Published by: qkc on August 25, 2009 20:15

qkc wrote:
Why use the read. Long to read the type of date in the following code?
Thank you

public void readExternal(PofReader reader)
throws IOException
{
setFirstName(reader.readString(0));
setLastName(reader.readString(1));
setHomeAddress((Address) reader.readObject(2));
setWorkAddress((Address) reader.readObject(3));
setTelephoneNumbers(reader.readMap(4, null));
setBirthDate(new Date(reader.readLong(5)));
}

Published by: qkc on August 25, 2009 20:15

Because the Java Date instances are stored internally as long (millisecs elapsed since the beginning of the year 1970), so to represent a Java Date, more efficient storage is just to store the long number returned by getTime() and use this long to build Date.

In addition, historically (with, for example, ExternalizableLite), there is no out-of-the-box support for attributes Date precisely, they were treated as simple objects (store lots of unnecessary data).

Best regards

Robert

Tags: Fusion Middleware

Similar Questions

  • Why the following code causes a time-out when you try to read a finite number of samples of the USB-6216?

    I do not have Measurement Studio, but I use the 4 available with DAQmx .NET support.

    The following code throws a timeout when calling ReadMultiSample(). Can someone please tell me what I'm doing wrong? I would get 40 000 samples with a sampling rate of 20 kHz. I've renamed by device USB-6216 of 'Meas1' by using MAX.

    [edit] I want to emphasize that I use AnalogMultiChannelReader because I intend to grab more than one channel once I understand that.

    Thanks in advance!

                using (task task = new Task()) {}
    task. AIChannels.CreateVoltageChannel ("Meas1/ai1", "", AITerminalConfiguration.Differential, -0.2, 0.2, AIVoltageUnits.Volts);
    task. Timing.SampleQuantityMode = SampleQuantityMode.FiniteSamples;
    task. Timing.SampleClockRate = 20000;
    task. Timing.SamplesPerChannel = 40000;
    AnalogMultiChannelReader reader = new AnalogMultiChannelReader (task. Stream);
    task. Start();
    samples is reader. ReadMultiSample (40000); // <-- timeout="" occurs="" during="" this="">
    task. Stop();
    }

    I forgot to put the SampleTimingType:

    task. Timing.SampleTimingType = SampleTimingType.SampleClock;

  • Why does take so long to load from the time wherever I power up until it takes to get to the login screen? help taking too long

    Why does take so long to load from the time wherever I power up until it takes to get to the login screen? help taking too long

    You should take a look at your startup programs and decide what is really necessary and what is nothing more than useless clutter. There is nothing wrong with the startup programs, some may be really useful or even necessary for your personal needs. But keep in mind that many programs build to start when you start the computer and that most of them must not start when the computer starts, all they do is slow down your boot time and clutter of things when you're trying to solve problems, and some are downright harmful!

    I mean, have you really need things like real Planner and Gadwin Print Screen running all the time? These programs will run very well, even if they are not started automatically every time that you start the computer. Go to these programs and change/disable their boot option. Some may be difficult to kill for public assistance services can be useful when you try to control startup programs. Try CodeStuff Starter, it's safe and easy to use, I think you'll like it, download it here:

    http://CodeStuff.tripod.com/products_starter.html>

    Use AutoRuns to check axis start, Richard:

    http://TechNet.Microsoft.com/en-us/sysinternals/bb963902.aspx>

    Use Cclenar-> tools-> start

    http://www.CCleaner.com/download/builds.aspx>

    I can't tell you what to keep, startup items it is a personal preference, but pretty well all the startup items indicated by CodeStuff Starter are safe to disable, and changes are easy to reverse if you change your mind. Searches for items it shows you and decide whether or not these things are really useful or necessary. Some programs will be started at startup without your knowledge and over time, that list can expand to include useless parasites, part of good computer maintenance includes regular control of these startup items and the removal of the unnecessary.

    Suggest that you first spread malware as the cause of the problem by following these steps:

    I. - delete your temporary files

    Clean the system (compensation to all temp/tmp folders and included all the content offline, the tif browser, delete the cookies of compensation.)

    Do a disk cleanup. Click the Start button. in the search box, type disk cleanupand then in the list of results, click Disk Cleanup. Better and easier to use - ccleaner.

    Download the basic version (slim) via

    http://www.Piriform.com/CCleaner/builds>

    The basic version (slim) does not contain the toolbar disgusted

    DO NOT USE ANY cleaning of the advanced options. DO NOT TOUCH THE REGISTRY OR TOOLS. At least not for now.

    Reset

    II. - have your system scanned as a result of security/antivirus installed.

    III. - download, install, update and run both of these tools to a-squared free scans:

    MalwareBytes anti-malware (MBAM)

    http://www.Malwarebytes.org/products/malwarebytes_free>

    SUPERAntiSpyware (SAS)

    http://SUPERAntiSpyware.com/superantispywarefreevspro.html>

    UTC/GMT is 18:16 on Wednesday, January 18, 2012

  • I'm locked out of my ipod5 that I have not used for a long time, it is not connected to the Internet or iTunes is anyway can I unlock?

    I'm locked out of my ipod5 that I have not used for a long time, it is not connected to the Internet or iTunes is anyway can I unlock? In my opinion, it works on IOS8. Because I have not used in a long time, it has reset and does not connect to the wifi until I unlock, and I forgot the password to unlock it. I tried to clear up my iPhone but it requires Internet and iPod can not connect to Internet ithe, I also tried to restore the 'home' button and the lock button while connected to iTunes on my computer and that did not work either... Please let me know if I haven't tried something or have missed something.

    Thank you

    You have to follow the instructions for the erasure or use recovery mode in iTunes again. . You do not specify what happened when you tried to follow these instructions, or instructions for iTunes, which you tried to follow, but you will be able to exit the mode disabled via iTunes if you do not have Wifi:

    If you have forgotten the password for your iPhone, iPad or iPod touch, or your device is disabled - Apple supports

    See you soon,.

    GB

  • After you have reinstalled my Window 7 Professional is not activate with the product key, I received with my package & which I used for a long time.

    After you have reinstalled my Window 7 Professional is not activate with the product key, I received with my package & which I used for a long time. I tried to activate using automated phone system, but could not do. What is the solution. I know that this product key I used only on my current desktop & in past I had not faced any problem on reappattage. This time, I had deleted all the parks & reformatted all readers of my Win7 teacher reappattage. This can be a cause of failure of activation?

    Direct activation number: (888) 725-1047

    1-800-936-5700

  • Please can someone help me for a long time out of the payment itun

    Please can someone help me for a long time out of the payment of itun, I lost my phone.

    This is my information

    ****

    ****

    Thank you

    < personal information under the direction of the host >

    OK so tell me first your reason! It of your personal account, why do you give?

  • Windows 7 takes a long time to load the desktop after login

    Hello

    I am using windows 7 on my HP 530 laptop. My friend who installed and activated, but I think that it has installed the cracked version. After installation, it was really perfect. but after a while when I connected to the internet, some updates have been installed, and then when I logged in the windows, he invites me that you are using a pirated version or something like that (I don't know more actually). then I restored to my previous state and then everything was fine. After that I stopped the automatic updates, but these days my startup window is having a few problems. After entering the password, its taking a long time to load the office and its keep on the list "loading, please wait...". »

    I'm so sick of that, also, I have to restart my laptop by pressing the power button, and after the reboot, it works fine. But I need someone to answerwhy its taking a long time to load the desktop...?

    Also, please give me some advice to solve this problem, keep this idea in mind that my computer is virus free and got a good processor and RAM. I installed my windows in the C drive, and in my C drive only almost 2 GB of space is left (or almost). and there is no program running auto in msconfig, other than gtalk, Skype, etc.

    I'll be really grateful if someone please give me the solution.

    HP would have provided your preinstalled laptop with win, they would also have provided a way to recover your laptop to the specifications of the factory, either through discs of recovery or a hidden restore partition that you need to access in order to make recovery disks. How do you access a recovery partition is an option of HP, is not dealing with a MS - visit the HP website, specific to your model for more details on how.

    If an illegal win7 version has been installed, or you have to buy version of win7 you need, or you need to recover your laptop provided that the factory provided, by doing so, you lose everything on the phone, if you have lost or that you can not do the restore cd and then telephone HP support they would usually provide records for a small fee.

  • Starting the server takes a long time due to the storage of JMS persistence files

    Hello

    We use WebLogic 9.2 on a windows machine.
    Recently, we have improved our request to work with JMS.
    We are on 2 different servers in a cluster using 2 JMS servers and works with distributed destinations.
    We use file storage as our persistence store.

    Recently, we found boot server takes a long time because of the actions that are performed on the storage of files.
    Analysis of this problem, we have seen that the size of the file is of ~ 2 GB.
    We understand that the file size does not fear (unless it is compacted manually), and its size matches the largest number ever of pending messages in the queues (as a mark of high tide).
    We shot also store debugging, using weblogic. Debug.DebugStoreIOPhysical and we saw a lot of recovery after newspapers file storage is open.
    We have checked and checked our JMS transactions are completed successfully. We also checked that the current messages and number of courses is 0.
    We stopped the server gracefully, check that there are no messages pending.
    However, several times takes start server ~ 30 minutes due to heavy work on the persistence store.
    Compaction or remove storage of files eliminates the delay.
    However, we want to avoid the manual operations whenever we want to start the server.

    Please share your ideas.

    Thank you
    Itsik

    The only suggestions I have off the top of my head are:

    * Ensure (1) the host system has at least 2 GB (the store file size) memory physics in addition to the memory used by the current process, and (2) the host system is not rebooted between each restart WebLogic. If you ensure that both of these, then the operating system puts implicitly cached content of the file of the store in memory even between boots - when WebLogic starts subsequently storing files, the o/s should be the content of the file much more quickly.

    * You can move to a JDBC store. Runtime JDBC store performance are lower, but since you have generally has only a small amount of records to retrieve, startup performance should be higher in this case.

    * Not that it helps your case, but it happens that we have significant performance improvements of starting process for a future version (if all goes well a near future release).

    Tom

  • Why all numbers use symbol 'L' in the following code?

    Why all numbers use symbol 'L' in the following code?
    Thank you
    public static final long MILLIS_IN_YEAR = 1000L * 60L * 60L * 24L * 365L

    qkc wrote:
    Why all numbers use symbol 'L' in the following code?
    Thank you

    public static final long MILLIS_IN_YEAR = 1000L * 60L * 60L * 24L * 365L
    

    Java language rules: an L after a literal integer in Java indicates that this constant should be kept as a long (64 bit signed) instead of int (32 bits signed).

    If you have not used to that, all the numbers on the line would be treated as integers (ints) (32 bit) and multiplier with an int int translates an int even if you want to store in a long.

    Since int cannot fully represent the full product (about 31.5 billion) as it is greater than Integer.MAX_VALUE (2 billion), so if you have not used the long as operands for multiplication, you finally get an incorrect value in MILLIS_IN_YEAR because the last multiplication would cause an overrun.

    Best regards

    Robert

  • Cannot copy file: cannot read the source code or drive WINDOWS XP

    I'm trying to transfer pictures on my old XP computer on an external hard drive.  After performing a backup on the drive hard seagate WD I went looking for pictures on the external hard drive, and they aren't there.  I went back on the XP machine and tried to copy the files to a CD but I get the message cannot copy file: cannot read the source code or the player.  I can open images but cannot move it to another folder or copy and paste pictures anywhere.  The photos are saved in an outdated version of microsoft's digital imaging software.  Help, please.

    Hello

    (1) is the specific question of the images?

    (2) where the images are on the computer?

    You can try the following methods and check the status of the issue.

    Method 1:

    Configure the computer to clean start State to check software conflicts. See the following link on how to configure Windows XP to start in a "clean boot" State

    http://support.Microsoft.com/kb/310353

    Note: When the diagnosis is complete, don't forget to reset your computer to normal startup. Follow step 4 of the above article.

    Method 2:

    If the problem is specific to the pictures folder, then it might be a problem with permission. You can try to take ownership of the folder and check if you can transfer it. read the following article.

    How to capture a file or a folder in Windows XP?

    http://support.Microsoft.com/kb/308421

  • Why dbms_lock.sleep (n seconds) Gets a deterministic behavior in the following code?

    Hello everyone,

    Parameter Value
    Oracle VersionEnterprise Edition Release 11.2.0.1.0 - 64 bit
    OPERATING SYSTEMLinux Fedora Core 17 (X86_64)

    Consider the following code:

    SET SERVEROUTPUT ON
    BEGIN
         sys.dbms_output.put_line('sleeping for 3 seconds');
         sys.dbms_lock.sleep(3);
         sys.dbms_output.put_line('done.');
    END;
    /
    SET SERVEROUTPUT OFF;
    

    I expect the above code to make, made in order the following:

    1. Print the message "sleep for 3 seconds"
    2. Sleep switch for 3 seconds
    3. Print the message 'done '.

    Yet, what is happening is that the program runs respectively then Step2 step 1 and finally Stap3. In other words the program first, sleeps, and once past the sleep period messages are printed.

    Could someone explain to me why?

    Thanks in advance,

    Kind regards

    Dariyoosh

    "

    Note:

    Messages sent usingDBMS_OUTPUT

    are not actually sent to the mailing of subroutine or complete relaxation. There is no mechanism to flush the output during execution of a procedure.

    "
    http://docs.Oracle.com/CD/E11882_01/AppDev.112/e25788/d_output.htm#CIHEGBBF

  • Problem using: read the spreadsheet file

    Hello

    I have 2 problems with reading spreadsheet file:

    (1) for the use of .txt file I can get the first column and not the other (even if I chose the correct output...)

    (2) this does not at all when you use my .xls file

    I must do something wrong but can't find what...

    Has anyone an idea?

    I have attached the .VI and my two files.

    Thank you

    User

    A native Excel file is NOT a text file.  It is a format of custom file created by Microsoft.  This is why you must use ActiveX to interact with him.

    The worksheet ' ' folder features found in the work of LabVIEW with text files (delimited by tabs, CSV, etc.).  The text files are a format more generic that can be read by programs such as Notepad.  Tried to use Notepad to open an .xls file?  It does not work.  Excel can open a text file, because it is a generic format.

    So even if everyone automatically thinks "Excel" when they see the word "Spreadsheet", the two are not synonymous.  In the case of LabVIEW, 'Spreadsheet' made reference to a delimited text file.

    Who is?

  • Is it possible to find bookmarks that I haven't used for a long time?

    I would like to delete bookmarks that I have not used over a long period of time. Is there a way to know when was the last time I used a bookmark?

    Firefox can come across your story, so if you do not erase the history you can kind of understand that. Here's what I mean.

    (1) open the Library dialog box to your Favorites. For example, bookmarks > show all bookmarks

    (2) in the top right search box, type http and make a pause while Firefox lists all matching bookmarks (should be almost all the)

    (3) If you do not have a column labeled Date of visit, made a right click No matter what column header and choose the Date of visit. (Or Mac equivalent of right-clicking.)

    (4) to sort by date, click on the header of column Date of visit. This should fix most recently visited vacuum. Click again to sort in the opposite effect.

    At this point, you may notice that the folder names are not displayed in the search results display. There is an add-on to show those if you decide that rather than delete you want doing drag and drop them into a folder of OLD STUFF "just in case" you will need it later.

    https://addons.Mozilla.org/firefox/addon/show-parent-folder/

    Is this useful?

  • Is there a file size limit when using read the spreadsheet file?

    I'm reading in a large file, approximately 52 MB, 525600 lines with 27 fileds in each line using "Read SpreadsheetFile.vi". I then explore table 2D-999, which represents bad/no data in this area and the total number of fields with-999 in there. All works on 3 months ' worth of data. The program is giving me a memory error output and stopping in case reading takes place on the file of the year a large. So my question is that the reading of the spreadsheet file has size limitations? Is there a better way to do it? Thanks in advance for the help.

    ssmith


  • Why Windows7 takes a long time to stop?

    It is not a hardware problem.

    I have the msconfig > startup/disabled services things I can.
    I just went through and uninstalled all only possible program that seems dangerous or that I never use.
    It takes about 5 minutes to go beyond "Shutting Down... »
    Ubuntu, which is installed on the same computer is operating normally. I think that the problem is related to a program that blocks the closing windows until he did what he should do. I think as its sql server (uninstalled all sql server stuff as I could get away with thinking).
    I ran Microsoft Security Essentials full scan.
    I'm really not one to install without thinking about it or download it from a place that I don't trust.
    I looked in the observer of events, but not really sure how to find the problem there. It's not like there is a single newspaper and then 5 minutes later another newspaper there. There is a constant flow of newspapers, I can say.
    I'm a developer, so I express vs and as I said sql server installed. I went to apache once and had to turn off tips of sql server and this computer has never forgiven me.
    This gets really annoying to wait half an hour to restart.

    Hi Warrior coding,.

    1. What is the brand and model of the computer?
    2. have you updated any drivers, including the chipset?
    3. were there any changes made to the computer before the question?
     
     
    See the following:
    Method 1:
    Try creating a new user account and check:
    You can view the following link to create the new user account:
    Method 2:
    Download the hotfix and check:
    There is a delay when you stop, restart or log off a computer that is running Windows 7 or Windows Server 2008 R2

    http://support.Microsoft.com/kb/975777

    Hope this information helps.

Maybe you are looking for