Xtra character appearing at the begining of a file written by my java pgm

Hi,
I am trying to write an object to an output file (which is a HTML document). But when the object is written at the
begining of the file the following character appears
' �� '
Is there a way to supress this character when the file is written ?
My java program is running in a Sun Solaris machine and the file is created in the same directory.
Thanks
Bala.

You have to give a lot more info... Are you trying to
write the object as an object (ie serialize it) or are you
simply trying to write the contents (data held in) this
object to an HTML file? Some code would help too.....
If you are simply wanting the contents written
be sure you are not trying to use an ObjectOutputStream...
If you are trying to write the Object (ie serialize it) then
you have to remember that there are chances of
non-printable characters being written...

Similar Messages

  • I have a OSX version 10.7.5. On Safari mail I can no longer see the information that usually appears at the beginning of an incoming email, like the date, senders details etc. What do I do to be able to see this again?

    I have a OSX version 10.7.5. On Safari mail I can no longer see the information that usually appears at the beginning of an incoming email, like the date, senders details etc. What do I do to be able to see this again?

    No, I get my mail on my computer, not on a website. I used to be able to see the information but in sorting another issue I must have changed a setting or something. I have gone to View. Under Message Attributes most things are ticked but many of them are not bold print i.e. they are pale grey. I don't know how to activate them again.

  • How to let the data appears at the beginning of the second page?

    Hi All,
    I've created a form-like report and it's layout model is like this:
    !http://up1.arb-up.com/files/arb-up-2009-9/Fgm23304.jpg!
    You can see parent repeating frame number 1 and child number 2 in red
    suppose that the normal frame containing f1 is suffused by fields within repeating frame 1
    If I run the report the first page will appear normally, but the second page the field f2 will not appear at the beginning of it. I want the field f2 appearing at the beginning of page 2 because there is a blank space at the beginning of it.

    give the property of the fiield f2 --> print object on -- All Pages.
    and give the property of field F_2 and child repeating Frame property --> vertical elasticity -- variable

  • Appending "something" at the beginning of a file

    Hello,
    I am trying to append a character to the beginning of a file, doesnt seem to work with RandomFileAccess. I first called the seek() methond
    seek(0); //zero to send the file pointer to the front 
    write((byte) myCharValue);apparently it overwrites the value at the front instead of adding for example:
    before running the code the file has: "Java is Cool!"
    after running the code the file has: "xava is Cool!"
    Any Ideas?
    Thanks

    1. Create a new file.
    2. Write out whatever you wanted to insert at the beginning.
    3. Copy the data from the old file and append it to the new file.
    4. Close the files.
    5. Delete the old file.
    6. Rename the new file.

  • How to delete the beginning of a file?

    Hi,
    is there a way to delete the beginning of a file, or do I have to copy the rest of the file and create a new one and then delete the old one?
    Lets say my file contains "ThisIsMyFile" and I want to delete "This", so that my new file contains "IsMyFile", how can I do this?
    thanx

    You have to copy.

  • How would I erase the beginning of a file?

    I want to be able to erase the beginning of a file, while writing to the end...WITHOUT reading the whole file and writing it again because that would be a waste of resourses. Obviously I know that option is available.
    My situation is that I am adding lines to a log file, and I want to remove any entries that are X hours old. Logging a lot of information would mean that every few seconds, an entry is older than X hours and needs to be removed. It doesnt have a set number of lines so I can't just recycle the file by doing something like: if at line number Y, start at line 1 and remember the current line number.
    Adding to the top of the file, pushing the others lines down, and making cuts at the end would also work, but the same situation arises, how do I add to the beginning of the file, without having to copy the entire file to add the entry to the top.
    The reason I don't want to read the whole file is because having to read the whole file and write the whole file when an entry is made is time consuming and wastes CPU and memory, especially when the logs are coming in several lines a second.

    I would think it could easily be done. say you want to erase the first 10 bytes, why cant you just say move the start of the file up 10 bytes. Somewhere in the filesystem the start of the file is stored. I found underlying file copying that claims this in FileChannel's transferTo and transferFrom:
    This method is potentially much more efficient than a simple loop that reads from this channel and writes to the target channel. Many operating systems can transfer bytes directly from the filesystem cache to the target channel without actually copying them.
    If I can't just chop, I'll have to copy quickly at scheduled intervals.
    This is code I ran to test the above quote:
        public static void main(String[] args) throws Exception{
            args = new String[2];
            BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
            System.out.println("Enter File Name:");
            args[0] = input.readLine();
            System.out.println("Enter test (0-2):");
            args[1] = input.readLine();
            long time = System.currentTimeMillis();
            int version = Integer.parseInt(args[1]);
            switch (version) {
                case 0:
                    BufferedReader in = new BufferedReader(new FileReader(args[0]));
                    PrintWriter out = new PrintWriter(new FileWriter("tempfile.txt"));
                    in.readLine();//skip line.
                    for (String line = in.readLine();line != null;line = in.readLine()) {
                        out.println(line);
                    in.close();
                    out.close();
                    break;
                case 1:
                    RandomAccessFile raf = new RandomAccessFile(args[0],"rw");
                    String line = raf.readLine();
                    long offset = raf.getFilePointer();
                    byte[] b = new byte[1024];
                    int bytes = 1024;
                    long index = 0;
                    System.out.println("index = " + raf.getFilePointer());
                    System.out.println("index = " + line.length());
                    while(bytes == 1024) {
                        bytes = raf.read(b);
                        index = raf.getFilePointer();
                        raf.seek(index - bytes - offset);
                        raf.write(b,0,bytes);
                        raf.seek(index);
                    raf.setLength(raf.length()-offset);
                    raf.close();
                    break;
                case 2:
                    RandomAccessFile raf2 = new RandomAccessFile(args[0],"rw");
                    String line2 = raf2.readLine();
                    long offset2 = raf2.getFilePointer();
                    FileChannel f = raf2.getChannel();
                    FileChannel g = f.position(0);
                    g.transferTo(offset2,raf2.length() - offset2,f);
                    raf2.setLength(raf2.length()-offset2);
                    raf2.close();
                    break;
            System.out.println(System.currentTimeMillis() - time);
        }and had these results
    166MB Log File
    Linux Mandrake 900Mhz
    Case 0 = 32914 ms
    Case 1 (1k byte[]) = 15043 ms
    Case 1 (16k byte[]) = 6988 ms
    Case 1 (1MB byte[] = 6113 ms
    Case 2 = 6188 ms
    :-/ guess this proves that the FileChannel can't chop

  • Append a line at the beginning of a file via UTL_FILE

    Hello,
    is there a way to append a line to the beginning of a file instead of at the end of an existing file via UTL_FILE?
    Thanks in advance,
    Geert

    No, you would have to create a new file.

  • About Final Cut ProX: why a red line appears at the top o a file imported into a New Event? then when I restarted the Project that files comes as "Missed files" How can i fix it?

    About Final Cut ProX: why a red line appears at the top o a file imported into a New Event? then when I restarted the Project that files comes as "Missed files" How can i fix it? Thank you very much.

    Where are you importing from – a camera or computer? If you are optimizing at import, make sure the background processes are completed. (Command-9)
    Russ

  • One second of black appearing at the beginning of each clip in timeline.

    I just got FCP and I'm having an issue.  Every time I put a clip from the event brower into the timeline, there's a second of black at the beginning of each clip.  This is only between clips, not the first one.  If I move a clip to the front, there's no second of blackness before it, but now the one that was put second has the blackness that wasn't there before. 
    I see in preferences, there's a transition setting, but it won't let me set it lower than one.  I figured this had to do w/ transistion effects, but could this be doing it?
    Both video and project are 720p HD 30p Stereo.
    I've googled all kinds of word combinations, but can't seem to find a solution.
    Any help?

    Complete mystery to me as well, and when I have something odd like this, I trot out the following suggestion:-
    Corrupt preferences can create a vast range of different symptoms, so whenever FCP X stops working properly in any way, trashing the preferences should be the first thing you do using this free app.
    http://www.digitalrebellion.com/prefman/
    Shut down FCP X, open PreferenceManager and in the window that appears:-
    1. Ensure that  FCP X  is selected.
    2. Click Trash
    The job is done instantly and you can re-open FCP X.

  • I'm trying to sync but it isn't working it appear that the beginning of sync has failed, what can i do?

    I bought my i pod and my friend asked me to do the downgrade, i tried it but not worked, now i'm trying to sync my songs and the message appear "The Ipod "iPod Matheus can't be syncronized because the beginning of the session has failed. " , i tryed to reset my ipod but it ins't working to.
    Sorry i'm brazilian and my english isn't very good, i hope u can help me, thanks o/

    Theis previous discussion may help.
    Sync Session Failed to Start iTouch iOS5: Apple Support Communities

  • Write filename to the beginning of that file.

    I need help on the following:
    While reading and validating a file in Java, HOW can I
    1. GRAB the FILENAME of the file I received,
    2. Open the file and WRITE the FILENAME at the BEGINNING of the file?
    Thank you in advanced.

    You can get the filename by using java.io.File.getName();
    As far as sticking it into the front of your file, you should read the whole old file (hopefully it's not too big), then write it all back out again to the same file, only write the name string first

  • Print data to the beginning of a file

    Hi,
    I have written this code to wite data to a textfile:
    PrintWriter FeedStream = new PrintWriter(new FileOutputStream(feed_path, true));
    FeedStream.println(text);
    FeedStream.close();The code works fine but it writes the data at the end of the file whereas I want it at the beginning of the file. How to solve this?
    Thanks in advance,
    leonard

    Well, the reason is that I want to print the data in another application and saving the data this way is more convenient.
    E.g.
    application 1 prints this to a file:
    L1 Test=45
    L2 Temp=10
    then the same application maybe has to write more data to the file at another time, and adding:
    L1 Test=39
    L2 Temp=12
    However application 2 that monitors the file every 6h should analyse the data from the newst to the oldest. For the conveniance when parsing the file with application 2 I want to add the data to the beginning of the file.

  • ITunes has recently began corrupting my music library and my Podcasts. An exclamation mark has appeared at the beginning of a random number of songs and against some Podcasts with the result that they will not play on iTunes. Message is that iTunes cannot

    iTunes has recently began corrupting my Music  and some of the Podcasts.  An exclamation mark appears at a random selection of songs - about a thoussanad of them - and they will not play as iTunes says that it cannot locate the file.  This also has happened on a number of Podcasts.  Any one else encountered this?

    This happens if the file is no longer where iTunes expects to find it. Possible causes are that you or some third party tool has moved, renamed or deleted the file, or that the drive it lives on has had a change of drive letter. It is also possible that iTunes has changed from expecting the files to be in the pre-iTunes 9 layout to post-iTunes 9 layout,or vice-versa, and so is looking in slightly the wrong place.
    Select a track with an exclamation mark, use Ctrl-I to get info, then cancel when asked to try to locate the track. Look on the summary tab for the location that iTunes thinks the file should be. Now take a look around your hard drive(s). Hopefully you can locate the track in question. If a section of your library has simply been moved, or a drive letter has changed, it should be possible to reverse the actions.
    Alternatively, if you are running Windows (you've posted in iTunes for Windows, but your sig mentions Mac OS X...), and as long as you can find a location holding the missing files, then you should be able to use my FindTracks script to reconnect them to iTunes.
    tt2

  • Creative Nomad Jukebox Zen Xtra Wont appear in the creative mediasource organiz

    I plug it into the usb dri've, and it doesnt show up. I look on My Computer, and it shows up as an audio device, and other. I go to my mediasource organizer, and it doesnt show up. I can access it on my computer, but it takes longer and I have no way of organizing my songs. I tried to re-install it, but it still doesnt work. It also doesn't work on my brothers 60gb one. Any help?

    hol3_c4t,
    Did you install the Nomad Jukebox Type 2 plugin also? If not, go to the download page and install those in order for the MediaSource application to identify the player.
    Jason

  • Keyboard - when I press the z key the y character appears on the screen and vica versa.

    I upgraded the software on by Q10 yesterday and now have a problem with the z and y characters.  Any ideas how to fix this?
    Solved!
    Go to Solution.

    Isn't it a keyboard layout setting?
    Like a shift between AZERTY and QWERTY for example. Check in the language input section of the preferences and see if you can find a solution there.
    Kepp us posted
    Please don't forget to mark as "solved" if your question is replied and to "like" a useful reply to your post ;-)

Maybe you are looking for