<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: BufferedWriter and Stringbuffer Issue- J2SDK.v.1.4.1 in Operating System - OpenVMS</title>
    <link>https://community.hpe.com/t5/operating-system-openvms/bufferedwriter-and-stringbuffer-issue-j2sdk-v-1-4-1/m-p/4003756#M12342</link>
    <description>Im using a different file name now but it has the same problem&lt;BR /&gt;&lt;BR /&gt;TEST13.TXT;1                  File ID:  (739634,8,0)&lt;BR /&gt;Size:          252/255        Owner:    [900013A,DAVIDQUINN]&lt;BR /&gt;Created:    22-MAY-2007 09:53:19.89&lt;BR /&gt;Revised:    22-MAY-2007 09:53:25.64 (1)&lt;BR /&gt;Expires:    &lt;NONE specified=""&gt;&lt;BR /&gt;Backup:     &lt;NO backup="" recorded=""&gt;&lt;BR /&gt;Effective:  &lt;NONE specified=""&gt;&lt;BR /&gt;Recording:  &lt;NONE specified=""&gt;&lt;BR /&gt;Accessed:   &lt;NONE specified=""&gt;&lt;BR /&gt;Attributes: &lt;NONE specified=""&gt;&lt;BR /&gt;Modified:   &lt;NONE specified=""&gt;&lt;BR /&gt;Linkcount:  1&lt;BR /&gt;File organization:  Sequential&lt;BR /&gt;Shelved state:      Online&lt;BR /&gt;Caching attribute:  Writethrough&lt;BR /&gt;File attributes:    Allocation: 255, Extend: 0, Global buffer count: 0, No version limit&lt;BR /&gt;Record format:      Variable length, maximum 0 bytes, longest 32767 bytes&lt;BR /&gt;Record attributes:  Carriage return carriage control&lt;BR /&gt;RMS attributes:     None&lt;BR /&gt;Journaling enabled: None&lt;BR /&gt;File protection:    System:RWED, Owner:RWED, Group:RE, World:&lt;BR /&gt;Access Cntrl List:  None&lt;BR /&gt;Client attributes:  None&lt;BR /&gt;&lt;/NONE&gt;&lt;/NONE&gt;&lt;/NONE&gt;&lt;/NONE&gt;&lt;/NONE&gt;&lt;/NO&gt;&lt;/NONE&gt;</description>
    <pubDate>Tue, 22 May 2007 06:07:36 GMT</pubDate>
    <dc:creator>quinnd6</dc:creator>
    <dc:date>2007-05-22T06:07:36Z</dc:date>
    <item>
      <title>BufferedWriter and Stringbuffer Issue- J2SDK.v.1.4.1</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/bufferedwriter-and-stringbuffer-issue-j2sdk-v-1-4-1/m-p/4003751#M12337</link>
      <description>I was using this version of java and Fast VM (build 1.4.1-2, build J2SDK.v.1.4.1 on OpenVMS. I wrote a program which appends strings to a string buffer.&lt;BR /&gt;It then converts the string buffer to a string and outputs that to a file using bufferedwriter.write&lt;BR /&gt;However it causes line breaks in the file where it shouldn't and I dont know why.&lt;BR /&gt;&lt;BR /&gt;Are there any known issues with bufferedwriter in this java version?&lt;BR /&gt;&lt;BR /&gt;What could be causing these fairly random line breaks?&lt;BR /&gt;Its also using  Fast VM (build 1.4.1-2, build J2SDK.v.1.4.1.&lt;BR /&gt;Can Fast VM run in different modes that might cause this?</description>
      <pubDate>Mon, 21 May 2007 03:37:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/bufferedwriter-and-stringbuffer-issue-j2sdk-v-1-4-1/m-p/4003751#M12337</guid>
      <dc:creator>quinnd6</dc:creator>
      <dc:date>2007-05-21T03:37:02Z</dc:date>
    </item>
    <item>
      <title>Re: BufferedWriter and Stringbuffer Issue- J2SDK.v.1.4.1</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/bufferedwriter-and-stringbuffer-issue-j2sdk-v-1-4-1/m-p/4003752#M12338</link>
      <description>quinnd6,&lt;BR /&gt;&lt;BR /&gt;  "fairly random"? Does this mean they're unrelated to the strings being appended?&lt;BR /&gt;&lt;BR /&gt;  What is the record format of your file? (DIR/FULL) Can you check the binary contents of the file around the apparent line breaks (use DUMP and compare with DUMP/RECORD). It may also be interesting to see the binary contents of your string buffer and again after it's been converted.</description>
      <pubDate>Mon, 21 May 2007 16:59:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/bufferedwriter-and-stringbuffer-issue-j2sdk-v-1-4-1/m-p/4003752#M12338</guid>
      <dc:creator>John Gillings</dc:creator>
      <dc:date>2007-05-21T16:59:25Z</dc:date>
    </item>
    <item>
      <title>Re: BufferedWriter and Stringbuffer Issue- J2SDK.v.1.4.1</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/bufferedwriter-and-stringbuffer-issue-j2sdk-v-1-4-1/m-p/4003753#M12339</link>
      <description>Ill show you my code and how it breaks.&lt;BR /&gt;Sometimes when I run it there are no bad line breaks and other times there would be one every 800 or so lines.&lt;BR /&gt;&lt;BR /&gt;import java.util.*;&lt;BR /&gt;&lt;BR /&gt;import java.util.*;&lt;BR /&gt;import java.io.*;&lt;BR /&gt;import java.io.BufferedWriter;&lt;BR /&gt;import java.io.BufferedReader;&lt;BR /&gt;import java.io.File;&lt;BR /&gt;import java.io.FileReader;&lt;BR /&gt;import java.io.IOException;&lt;BR /&gt;import java.io.Serializable;&lt;BR /&gt;&lt;BR /&gt;import java.text.SimpleDateFormat;&lt;BR /&gt;import java.util.*;&lt;BR /&gt;class Test3 {&lt;BR /&gt;&lt;BR /&gt;public static void main(String[] args) throws IOException {&lt;BR /&gt; String contents = "";&lt;BR /&gt;  int lSize = 0;&lt;BR /&gt;&lt;BR /&gt;  FileWriter fw = new FileWriter("test10.txt");&lt;BR /&gt;&lt;BR /&gt;  BufferedWriter bw = null;&lt;BR /&gt;  StringBuffer strb = new StringBuffer();&lt;BR /&gt;   &lt;BR /&gt;   &lt;BR /&gt;    strb.append("allow_from");&lt;BR /&gt;    strb.append(" ");&lt;BR /&gt;    strb.append("dq@dq.com");&lt;BR /&gt;    strb.append("\n");&lt;BR /&gt; String bufferString  =strb.toString();&lt;BR /&gt;  try {&lt;BR /&gt;   bw = new BufferedWriter(fw);&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;   // Now put together the contents of the file:&lt;BR /&gt;    for(int i=1;i&amp;lt;60000;i++)&lt;BR /&gt;    {&lt;BR /&gt;   &lt;BR /&gt;    bw.write(i+ " "+bufferString);&lt;BR /&gt;     &lt;BR /&gt;    }&lt;BR /&gt;catch(IOException ioe) {&lt;BR /&gt;   throw ioe;&lt;BR /&gt;  }&lt;BR /&gt;  finally {&lt;BR /&gt;   if(bw!=null) bw.close();&lt;BR /&gt;  }&lt;BR /&gt;  &lt;BR /&gt;&lt;BR /&gt;  &lt;BR /&gt;&lt;BR /&gt; }&lt;BR /&gt;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 22 May 2007 03:29:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/bufferedwriter-and-stringbuffer-issue-j2sdk-v-1-4-1/m-p/4003753#M12339</guid>
      <dc:creator>quinnd6</dc:creator>
      <dc:date>2007-05-22T03:29:15Z</dc:date>
    </item>
    <item>
      <title>Re: BufferedWriter and Stringbuffer Issue- J2SDK.v.1.4.1</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/bufferedwriter-and-stringbuffer-issue-j2sdk-v-1-4-1/m-p/4003754#M12340</link>
      <description>I changed the for loop to go from 1 to 5001 and then.&lt;BR /&gt;I tried  running it on windows and then I sent the program and the text file I had been writing to on windows over to the open vms machine.&lt;BR /&gt;&lt;BR /&gt;Then when I ran it on open vms  there were the line breaks on line 988 and 1303, line 1618 etc. like this (note I havent put in all the lines cos it'd take up to0 much space)&lt;BR /&gt;987 allow_from dq@dq.com&lt;BR /&gt;988 allow&lt;BR /&gt;_from dq@dq.com&lt;BR /&gt;989 allow_from dq@dq.com&lt;BR /&gt;&lt;BR /&gt;1301 allow_from dq@dq.com&lt;BR /&gt;1302 allow_from dq@dq.com&lt;BR /&gt;1303 allow_from dq@dq.c&lt;BR /&gt;om&lt;BR /&gt;1304 allow_from dq@dq.com&lt;BR /&gt;1305 allow_from dq@dq.com&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;1618 allow_from dq@dq.com&lt;BR /&gt;&lt;BR /&gt;1619 allow_from dq@dq.com&lt;BR /&gt;&lt;BR /&gt;1933 allow_from dq@dq.com&lt;BR /&gt;1&lt;BR /&gt;934 allow_from dq@dq.com&lt;BR /&gt;1935 allow_from dq@dq.com&lt;BR /&gt;1936 allow_from dq@dq.com&lt;BR /&gt;&lt;BR /&gt;2248 allow_from dq@dq.com&lt;BR /&gt;224&lt;BR /&gt;9 allow_from dq@dq.com&lt;BR /&gt;2250 allow_from dq@dq.com&lt;BR /&gt;&lt;BR /&gt;so it does that every 300 lines or so and all other lines seem ok.&lt;BR /&gt;It seems to be because I sent a text file over from windows to open vms and it got corrupted.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 22 May 2007 04:21:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/bufferedwriter-and-stringbuffer-issue-j2sdk-v-1-4-1/m-p/4003754#M12340</guid>
      <dc:creator>quinnd6</dc:creator>
      <dc:date>2007-05-22T04:21:58Z</dc:date>
    </item>
    <item>
      <title>Re: BufferedWriter and Stringbuffer Issue- J2SDK.v.1.4.1</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/bufferedwriter-and-stringbuffer-issue-j2sdk-v-1-4-1/m-p/4003755#M12341</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;First, welcome to the VMS forum.&lt;BR /&gt;&lt;BR /&gt;I tested your program with a different version of java (Classic VM (build 1.5.0-3, 03/01/2007-14:39, native threads, jit) and Fast VM (build 1.5.0-3, build J2SDK.v.1.5.0:03/01/2007-21:16, native threads, ji&lt;BR /&gt;t_150)). I cant reproduce the error.&lt;BR /&gt;&lt;BR /&gt;Was the test10.txt a new file or only a new version of an existing file? Java (read as C) keeps the attributes of the existing file.&lt;BR /&gt;Could you post the DIR/FULL output as John suggested.&lt;BR /&gt;&lt;BR /&gt;A quick check to line breaks you posted gives  me the numbers:&lt;BR /&gt;first break at character position 24576 (0x6000)&lt;BR /&gt;second break at character position 32768 (0x8000)&lt;BR /&gt;&lt;BR /&gt;The second is intresting 32767 is the maximal record size for many sequential file formats.&lt;BR /&gt;&lt;BR /&gt;Bojan</description>
      <pubDate>Tue, 22 May 2007 05:27:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/bufferedwriter-and-stringbuffer-issue-j2sdk-v-1-4-1/m-p/4003755#M12341</guid>
      <dc:creator>Bojan Nemec</dc:creator>
      <dc:date>2007-05-22T05:27:04Z</dc:date>
    </item>
    <item>
      <title>Re: BufferedWriter and Stringbuffer Issue- J2SDK.v.1.4.1</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/bufferedwriter-and-stringbuffer-issue-j2sdk-v-1-4-1/m-p/4003756#M12342</link>
      <description>Im using a different file name now but it has the same problem&lt;BR /&gt;&lt;BR /&gt;TEST13.TXT;1                  File ID:  (739634,8,0)&lt;BR /&gt;Size:          252/255        Owner:    [900013A,DAVIDQUINN]&lt;BR /&gt;Created:    22-MAY-2007 09:53:19.89&lt;BR /&gt;Revised:    22-MAY-2007 09:53:25.64 (1)&lt;BR /&gt;Expires:    &lt;NONE specified=""&gt;&lt;BR /&gt;Backup:     &lt;NO backup="" recorded=""&gt;&lt;BR /&gt;Effective:  &lt;NONE specified=""&gt;&lt;BR /&gt;Recording:  &lt;NONE specified=""&gt;&lt;BR /&gt;Accessed:   &lt;NONE specified=""&gt;&lt;BR /&gt;Attributes: &lt;NONE specified=""&gt;&lt;BR /&gt;Modified:   &lt;NONE specified=""&gt;&lt;BR /&gt;Linkcount:  1&lt;BR /&gt;File organization:  Sequential&lt;BR /&gt;Shelved state:      Online&lt;BR /&gt;Caching attribute:  Writethrough&lt;BR /&gt;File attributes:    Allocation: 255, Extend: 0, Global buffer count: 0, No version limit&lt;BR /&gt;Record format:      Variable length, maximum 0 bytes, longest 32767 bytes&lt;BR /&gt;Record attributes:  Carriage return carriage control&lt;BR /&gt;RMS attributes:     None&lt;BR /&gt;Journaling enabled: None&lt;BR /&gt;File protection:    System:RWED, Owner:RWED, Group:RE, World:&lt;BR /&gt;Access Cntrl List:  None&lt;BR /&gt;Client attributes:  None&lt;BR /&gt;&lt;/NONE&gt;&lt;/NONE&gt;&lt;/NONE&gt;&lt;/NONE&gt;&lt;/NONE&gt;&lt;/NO&gt;&lt;/NONE&gt;</description>
      <pubDate>Tue, 22 May 2007 06:07:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/bufferedwriter-and-stringbuffer-issue-j2sdk-v-1-4-1/m-p/4003756#M12342</guid>
      <dc:creator>quinnd6</dc:creator>
      <dc:date>2007-05-22T06:07:36Z</dc:date>
    </item>
    <item>
      <title>Re: BufferedWriter and Stringbuffer Issue- J2SDK.v.1.4.1</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/bufferedwriter-and-stringbuffer-issue-j2sdk-v-1-4-1/m-p/4003757#M12343</link>
      <description>I suspect with others that the program is writting the file as a long records with embedded new-lines, rather then many independent lines as intended.&lt;BR /&gt;However, that math does not work exacltly.&lt;BR /&gt;I would suggest that the line length of about 32, not the 26 shown.&lt;BR /&gt;&lt;BR /&gt;To verify, check the output from $DUMP/RECORD=COUNT=1 &lt;FILE.DAT&gt;&lt;BR /&gt;&lt;BR /&gt;You probably want to force a 'STREAM_LF' or STREAM output file. I don't know enough about the tools you used to help you force this. It could be a logical names, an open option, or the (non) presence of an existing file with the same name and the desired attributes.&lt;BR /&gt;To create such file, try:&lt;BR /&gt;&lt;BR /&gt;$CREATE/FDL=SYS$INPUT:  &lt;FILE.DAT&gt;&lt;BR /&gt;RECORD; FORMAT STREAM_LF&lt;BR /&gt;$&lt;BR /&gt;&lt;BR /&gt;What OpenVMS version? &lt;BR /&gt;It may be a  problem which has been fixed?&lt;BR /&gt;&lt;BR /&gt;Good luck,&lt;BR /&gt;Hein.&lt;BR /&gt;&lt;/FILE.DAT&gt;&lt;/FILE.DAT&gt;</description>
      <pubDate>Tue, 22 May 2007 06:39:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/bufferedwriter-and-stringbuffer-issue-j2sdk-v-1-4-1/m-p/4003757#M12343</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2007-05-22T06:39:40Z</dc:date>
    </item>
    <item>
      <title>Re: BufferedWriter and Stringbuffer Issue- J2SDK.v.1.4.1</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/bufferedwriter-and-stringbuffer-issue-j2sdk-v-1-4-1/m-p/4003758#M12344</link>
      <description>Hein was faster than me.&lt;BR /&gt;&lt;BR /&gt;You can try also to force stream_lf with:&lt;BR /&gt;&lt;BR /&gt;$ DEFINE JAVA$CREATE_STMLF_FORMAT TRUE&lt;BR /&gt;&lt;BR /&gt;Bojan</description>
      <pubDate>Tue, 22 May 2007 07:01:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/bufferedwriter-and-stringbuffer-issue-j2sdk-v-1-4-1/m-p/4003758#M12344</guid>
      <dc:creator>Bojan Nemec</dc:creator>
      <dc:date>2007-05-22T07:01:10Z</dc:date>
    </item>
    <item>
      <title>Re: BufferedWriter and Stringbuffer Issue- J2SDK.v.1.4.1</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/bufferedwriter-and-stringbuffer-issue-j2sdk-v-1-4-1/m-p/4003759#M12345</link>
      <description>The open vms version is&lt;BR /&gt;OpenVMS Alpha V7.3-1</description>
      <pubDate>Tue, 22 May 2007 08:06:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/bufferedwriter-and-stringbuffer-issue-j2sdk-v-1-4-1/m-p/4003759#M12345</guid>
      <dc:creator>quinnd6</dc:creator>
      <dc:date>2007-05-22T08:06:21Z</dc:date>
    </item>
  </channel>
</rss>

