Why when I open the output.txt file, is strange code there, not 3.1

i almost copy the example from "think in java book" chapter 11
however, the result "output.txt file" when opened by notepad of windows xp, always only very strange code inside, not what i want
do i need open the file, before i want to write?
or i use a wrong api again?
or the java code norm is very difference from ms windows?
thanks
import java.util.Random;
import java.io.*;
class CreatRandomFile
     public static void main(String args[])throws IOException
          File fileOutput=new File("output.txt");
          DataOutputStream out2=
               new DataOutputStream(
                    new BufferedOutputStream(
                         new FileOutputStream(fileOutput)));
          out2.writeDouble(3.1);
          out2.close();
     }//end main
}//end class

There are basically two ways of IO:
a) human readable format;
b) machine readable format;
What you've just done is writing a double value in machine readable
format to a file. Some folks call it 'binary format'. I bet your file is eight
byes long. A DataOutputStream writes data in machine readable
format. You need a PrintStream instead if you (a being human I suppose)
want to be able to read the contents of that file.
kind regards,
Jos

Similar Messages

  • Every time I open a pdf file which includes a javascript, a dialogue box pops up. I have a question why 'Do not show this message again' is not working even I checked on the checkbox. It should block the dialogue next time when I open the same pdf file bu

    Every time I open a pdf file which includes a javascript, a dialogue box pops up. I have a question why 'Do not show this message again' is not working even I checked on the checkbox. It should block the dialogue next time when I open the same pdf file but not working. What is the matter and how can I deal with it?

    I am trying it on Adobe Acrobat Reader 9.2.1. Tried to fix Hex code, and also tried 'edit-preference-trust manager'. I focusing on Adobe registries but still couldn't fix the problem.

  • How to Open the FailedFilesLog.txt File (statement), and How to Increase the 100 File Limit (question)

    It took us a while to figure this out, so I'm posting this in case it's helpful for someone out there. Plus, I have a question...
    DPM gave the following error for one of our file servers:
    Description: The replica of Volume D:\ on <servername> is inconsistent with the protected data source. Number of files skipped for synchronization due to errors has exceeded the maximum allowed limit of 100 files on this data
    source (ID 32538 Details: Internal error code: 0x809909FE)
    Recommended action: Review the failure errors for individual files from the log file
    \\?\Volume{8492c150-f195-11de-a186-001cc4ef89a0}\B1E9D373-2C03-464E-A472-99BC93DB1E2A\FailedFilesLog.txt and take appropriate action. If some files fail consistently, you can exclude the folders containing these files by modifying the protection group or
    moving the files to another location.
    So, how do you actually open the FailedFilesLog.txt file shown in this DPM alert? What is this path referring to? Well, this is the mount point for the protected server's replica volume on the DPM server, which is mounted under \Program
    Files\Microsoft DPM\DPM\Volumes\Replica\servername\File System. Here you'll see the mount points for all of the server's protected volumes. However, if you try to open one of these mounted volumes
    in Windows Explorer, you'll get Access Denied, even if you have administrator rights. (If someone knows of a way around this, please let me know). As a workaround, you can access this mounted volume in an elevated
    command prompt. Steps:
    Open an Administrator Command Prompt
    Type mountvol <AnyAvailableDriveLetter>: \\?\Volume{VolumeGUID}
    Example:  mountvol m: \\?\Volume{8492c150-f195-11de-a186-001cc4ef89a0}   Note that we're only using the first part of the path to the FailedFilesLog.txt
    file given in the DPM alert, starting from \\? and ending after the
    } character.
    Next, type m: to change to the newly mounted m: drive.
    Then type cd B1E9D373-2C03-464E-A472-99BC93DB1E2A   This is actually a folder name so we're just going into this folder.
    Finally type dir and you should see the FailedFilesLog.txt file. This file can be copied to another location where it's easier to use (i.e. in Windows Explorer).
    Be sure to unmount this volume when you're done by typing mountvol m: /d in the command prompt. (Mountvol reference:
    http://technet.microsoft.com/en-us/library/cc772586(WS.10).aspx.)
    What a pain, eh? But at least by reviewing the FailedFilesLog.txt file you can determine which files or folders caused the sync to fail and thus take action accordingly.
    Now, here's my question: Where is that registry key that lets me adjust the limit of 100 files that DPM allows to be skipped before it fails the replica? Hopefully someone out there will tell me. I know this can be done because Kapil Malhotra
    said so in this post:
    http://groups.google.com/group/microsoft.public.dataprotectionmanager/browse_thread/thread/a179fa30fb50c9b0/e9a348f2a9386063?lnk=raot.
    Also, does anyone know what the internal error code 0x809909FE means in this alert? Knowing this my help us determine what caused these files to fail. Interestingly, in the FailedFilesLog.txt file, it gave a different error code next to each failed file:
    0x80070002.
    -Taylorbox

    Thanks for responding, Fahd. So, just to be sure...
    Do I add this registry key to the DPM server or to the protected servers (or both)?
    In either case, the ContinueOnFailure key does not currently exist. So, I must create this key and the MaxFailedFiles DWORD value
    manually, right?
    Does the server in which I create this regkey have to be restarted for it to take affect?
    Can the DPM alert for the 0x809909FE error event (for exceeding the limit of 100 failures) please be adjusted to provide a path to the FailedFilesLog.txt file
    that actually works if you click on it?
    Any ideas on why the 0x80070002 "File not found" error happened? The files on the server were simply created and then deleted. Why would such file activity lead to this error?
    Thanks,
    -Taylorbox

  • Want to display a space after last field in the output txt file

    hi
    I want to display a space after last field in the output txt file which is generaed by my program on utility server the last field lengyt we have defined is four and in database it is of three characters and requirement is to disppaly the last fourth field as space in the output file w hich is not shown as the txt file automatically gets closed at the third place as it is the last field in the record and ind atabase records are of therss char only but user wants to display this fourth position in the notepad output file as space ( which is last field in the output file)
    eg
    name house  street country
    record output coming in file
    ram   h3      street3  thn      now this thn which is last field the notepad get closed at thn only
    i want to display one space in last field for the whole of output file
    ie ram      h3   street3  thn(space)
        sham   h4  street4   sgp(space)  so on......
    we need to show this space in the output file as blank
    regards
    Arora

    hi Atish
    i am using
    loop at gt_sagadr_outtab into wa_sagadr_outtab
    move wa_sagadr_outtab-country to wa_sagadr_text+223(226).
    endloop
    in this last field ie country i need to display the last 226 as blank as only country key is two char in database so the last space is not shown
    i am not unsing the fM as tolb by  you
    and afterwards
    i am usning
    Concatenate 'Sagadr_' sy-datum sy-uzeit '.dat' into gv_filename_sagadr.
    CALL FUNCTION 'FILE_GET_NAME'
      EXPORTING
      CLIENT                        = SY-MANDT
        LOGICAL_FILENAME              = gc_lfile
        OPERATING_SYSTEM              = SY-OPSYS
        PARAMETER_1                   = gc_param1
        PARAMETER_2                   = gc_send
        PARAMETER_3                   = gv_filename_sagadr
      USE_PRESENTATION_SERVER       = ' '
      WITH_FILE_EXTENSION           = ' '
      USE_BUFFER                    = ' '
      ELEMINATE_BLANKS              = 'X'
      IMPORTING
      EMERGENCY_FLAG                =
      FILE_FORMAT                   =
        FILE_NAME                     =  gv_filepath_sagadr
    EXCEPTIONS
      FILE_NOT_FOUND                = 1
      OTHERS                        = 2
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    and lastly
    open dataset gv_filepath_sagadr for output in text mode encoding default.
        if sy-subrc eq 0.
         loop at gt_sagadr_text into wa_sagadr_text.
         transfer wa_sagadr_text to gv_filepath_sagadr.
         endloop.
        endif.
       close dataset gv_filepath_sagadr.
        if sy-subrc = 0.
        message S002 with gv_filepath_sagadr. "Files & created on Application server
        endif.
    SO NOT SURE WHERE TO USE THE CODE AND HOW

  • Why+does+firefox+open+the+following+tab+file%3A%2F%2F%2FC%3A%2FUsers%2FTom%2FAppData%2FLocal%2FTemp%2Frpc.html

    why+does+firefox+open+the+following+tab+file%3A%2F%2F%2FC%3A%2FUsers%2FTom%2FAppData%2FLocal%2FTemp%2Frpc.html

    Just delete that file in the temp folder and cleanup that folder.
    *file:///C:/Users/Tom/AppData/Local/Temp/rpc.html
    See these articles for some suggestions:
    * https://support.mozilla.com/kb/Firefox+has+just+updated+tab+shows+each+time+you+start+Firefox
    * https://support.mozilla.com/kb/How+to+set+the+home+page - Firefox supports multiple home pages separated by '|' symbols

  • I own an account on iTunes two years ago, almost always used it two days ago, the account stops working do not know why when I open the account Italpin reset your password and resend the email to and I did not receive any Klnh aftermarket tried a lot and

    hi
    I own an account on iTunes two years ago, almost always used it two days ago, the account stops working do not know why when I open the account Italpin reset your password and resend the email to and I did not receive any Klnh aftermarket tried a lot and Amaisalna something please help

    CHANGING APPLE ID/EDIT ACCOUNT INFORMATION/CHANGE ITUNES COUNTRY
    Tap Settings / iTunes & App Stores, then tap the Apple ID signed in. Sign out of the current Apple ID account and then sign in with another account or create a new Apple ID http://support.apple.com/kb/HT2731?viewlocale=en_US
    To edit account information tap Settings / iTunes & App Stores / Apple ID: / View Apple ID
    To change your iTunes Store country, sign in to the account for the iTunes Store region you would like to use, tap Settings/iTunes & App Store/Apple ID/View Apple ID/Country/Region
    Read this article for information http://support.apple.com/kb/HT1311

  • Sometimes, when we open the multiple pdf files, menu bar is disappearing without any reason.

    Sometimes, when we open the multiple pdf files, menu bar is disappearing without any reason.

    Hi pramodg23752205,
    Okay, so are you facing this issue with all the machines or with a particular machine?
    Does 'F9' key resolves the issue?
    Regards,
    Rahul

  • I updated my Itunes but now when i open the window it's blank. I'm not sure what to do.

    I updated my Itunes but now when i open the window it's blank. I'm not sure what to do.

    You might try this tip....iTunes 11.1.3 appears to have flawed permissions:
    Repair permissions either with Disk Utility in the Applications/Utilities folder or on the command line with:
    diskutil repairPermissions /

  • When I open the Adobe reader file, I have to click several times

       I have a problem in this Adobe Readear program.
    When I open the file, I have to click several times and then the file open.
    It does not open the file at a time.
    I install again and again. But it doen't get better.
    What do I do?
    I would appreciate a prompt reply.

    I don't know what is causing that; all I can do is guess.
    Can you keep Task Manager (Processes tab) open in a smaller window, then double click on a PDF file in another window.  Does AcroRd32.exe come alive for a very short time, then disappear?
    You could also use a Tool like Process Monitor to find out what's going on.  Set the filter to Process Name = AcroRd32.exe before you start.

  • Error opening the portable document file document. error code = 0x4000000c

    I have been getting this error message when I try to open a .pdf that was created in Word. I have searched for this error code and nothing comes up.
    The file was created from a Word newsletter template. I had no problem opening this in PS before I updated my Adobe Acrobat Pro. The file CAN be opened in Acrobat however.
    Any advice as to what this code means and why I can't opne the file anymore?
    thanks,
    Lisa

    Thanks for the reply, Chris. In this case I can switch the project over to InDesign, but writing out a Word file to PDF is a pretty common thing to do, so I hope they eventually have time to fix it for those of us having the problem.
    I understand updating for the upgrade, but not everyone can afford to upgrade to a new set of CS software every time a new version is released. At work is one thing, but I can't justify it for my personal copy. And I know you didn't mean it that way, but I hope that Adobe doesn't forget about its CS3 users just because CS4 is the latest version. The Creative Suite is a pretty expensive piece of software to buy to quickly become old and not worthy of bug fixes.
    Thanks for forwarding my file along though.
    Have a good afternoon,
    Debbie

  • Why when I opened pages app on my iPad we're the documents there and then disappeared?  Now they are gone!

    Can anyone tell me why when I opened the pages app all my documents were there and then disappeared.  Now they are gone!!!!  How can I get them back?

    Try this:
    1) On a web browser (on a computer, not on an iPad) go to iCloud.com
    2) sign in with your Apple ID and password.
    3) Once you are signed in, select the orange 'Pages' icon.
    4) If there are welcome screens, continue until you get to Pages web version
    5) Are your documents showing there?
    If yes, delete Pages app from your iPad, and reinstall it. Your documents should reappear when you open it after installing. If no, then the only possibility would be if you have previously made a back up on your computer with iTunes.

  • When I open the website as oldc.in on firefox then sometimes there images are out of the boxes? Can anyone tell me what can I do for it?

    When I open the website as http://oldc.in then there posting are going out of boxes so please can anyone tell me about fixing this problem? This problem is going only with mozilla firefox.

    Can you attach a screenshot?
    *http://en.wikipedia.org/wiki/Screenshot
    *https://support.mozilla.org/kb/how-do-i-create-screenshot-my-problem
    Use a compressed image type like PNG or JPG to save the screenshot.
    If you have made changes to Advanced font settings like increasing the minimum/default font size then try the default minimum setting "none" and the default font size 16 in case the current setting is causing problems.
    *Tools > Options > Content : Fonts & Colors > Advanced > Minimum Font Size (none)
    Make sure that you allow pages to choose their own fonts.
    *Tools > Options > Content : Fonts & Colors > Advanced: [X] "Allow pages to choose their own fonts, instead of my selections above"
    *http://kb.mozillazine.org/Websites_look_wrong
    *http://kb.mozillazine.org/Website_colors_are_wrong

  • I have a brand new macbook pro 15" with latest Lion.Can anyone tell me why, when I open word or preview etc that multiple files open?For eg if I open a word doc, the last 1-3 docs that I have worked on all open. why?

    I have a brand new macbook pro 15" with latest Lion. Can anyone tell me why, when I open word or preview etc that multiple files open?For eg if I open a word doc, the last 1-3 docs that I have worked previously on all open. Can anyone tell me why?

    You have a choice as to whether or not applications in Lion like Word or Preview (or even Safari) save and re-open previous documents or windows... just hold down the option key while quitting a program and when you re-open it you won't get the previous documents or windows when you re-open the application. You can see this by selecting the open program in the menu bar and when holding down the option key the quit function will change to quit and discard open windows. This feature in Lion is referred to as "Resume" and is great if you want to restart an app and return to what you're doing (for example in Safari re-opening existing windows and tabs from your previous session). You still have the option to close individual windows within an app before quitting and they will not re-open when the app is launched again.
    This Resume function is not related to saving your work (a word or text document for example). This is handled by Lion's "Auto-Save" and "Versions" functions. See http://www.apple.com/ca/macosx/whats-new/auto-save.html
    Hopefully this is the complete answer you're looking for.

  • Why, when I right click on a file am I only given the CS6 option to open in?

    Why, when I right click on a file am I only given the CS6 option to open in? Before installing the CS6 "cloud" programs I would be given an option to open in any software or version that would be an appropriate program to open the file. If I want to open a jpg in Photoshop CS5 so I can use the plugins that I have not yet installed in CS6 I can only open it by opening Photoshop CS5 and open it through the Photoshop dropdown.
    I am working in Windows 7 professional. I am subscribed to the CS6 "cloud" annual subscription.

    If I have to go to the trouble to open in bridge I might as well open Photoshop CS5, browse to the file and open it. My point is, before CS6 I could simply right click on a file in its folder and have the option to open it in any program that it could be opened in. Previously it would give me the options for past versions. Now a PSD only gives me the option of Photoshop CS6 even if it was created in CS5. This is also happening with InDesign files and Illustrator files. Quite an inconvienence, especially in the transition period.

  • Why when I open an app (i.e. Word) some of the files I previously worked on also load/open? How do I prevent this from happening?

    Why when I open an app (i.e. Word) some of the files I previously worked on also load/open? How do I prevent this from happening?

    System Preferences>General...remove the check for the box labeled "Restore Windows when Quitting & re-opening apps".

Maybe you are looking for

  • Custom report to work in different languages EN and ZH.

    Hi, I wrote the report which has to work on languages EN and ZH(chinese language). It is working fine in EN, When I login with language 'ZH', the selecion screen is not displaying in Chinese language. Is there anything to do to display the selection

  • Not able to get the alerts in CCMS to distribution lists.

    Hi All, I have created the distribution lists - >Create Auto reaction Method ->Assigned the distribution list is added in the Parameters SENDER                 DDIC RECIPIENT              CCMS_2 RECIPIENT-TYPEID       C REACT_ON_ALERTS        RED SUB

  • 2011 17" Macbook Pro constantly drops Wifi connection on Windows 7 but not OSX. What's going on???

    On OSX, the Wifi works perfectly. I rarely if ever get disconnected from the internet. However, when I switch over to Windows 7, the internet drops constantly (every 30 seconds or so). I recently updated my OSX to the newest one (I think Yosemite) th

  • Do i have to register my ipad air

    I just bought a I Pad Air do I have to register it for warranty? if so where do I do that.? Thanks 

  • Trial versions

    Is it true that most applications (especially the more expensive ones) do not offer trial/demo versions? For example, I am trying to decide on a birding field guide out of several choices. iBird offers a free app that has data on 15 birds (as opposed