harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tim Ellison (JIRA)" <j...@apache.org>
Subject [jira] Closed: (HARMONY-508) [classlib][luni] java.io.FileOutputStream.getChannel().position() returns incorrect value on Linux platform
Date Fri, 04 Jan 2008 11:35:34 GMT

     [ https://issues.apache.org/jira/browse/HARMONY-508?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Tim Ellison closed HARMONY-508.
-------------------------------


Finally closing this issue.  I fixed Paulex's concerns in the testcase in repo revision r608805.


> [classlib][luni] java.io.FileOutputStream.getChannel().position() returns incorrect value
on Linux platform
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-508
>                 URL: https://issues.apache.org/jira/browse/HARMONY-508
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Nikolay Bannikov
>            Assignee: Tim Ellison
>            Priority: Minor
>         Attachments: FileOutputStreamTest.diffs, harmony-508.diff
>
>
> According to  J2SE 1.5 specifications: 
> The initial position of the returned channel will be equal to the number of bytes written
to the file so far unless this stream is in append mode, in which case it will be equal to
the size of the file. 
> import java.io.*; 
> public class Test{ 
>     public static void main(String[] args) { 
>         FileOutputStream f = null; 
>         try { 
> 	File tmpfile = File.createTempFile("FileOutputStream", "tmp");
> 	tmpfile.deleteOnExit(); 
>         	FileOutputStream fos = new FileOutputStream(tmpfile); 
>          	byte[] b = new byte[10]; 
>         	for (int i = 10; i < b.length; i++) { 
>             	 b[i] = (byte) i; 
>         	} 
>         	fos.write(b); 
> 	fos.flush();                 
> 	fos.close(); 
> 	f = new FileOutputStream(tmpfile, true);
> 	System.out.println("position = "+f.getChannel().position()); 
>         } catch (FileNotFoundException fnfe) { 
>         } catch (IOException ioe) { 
>         } catch (SecurityException se) { 
>         } 
>    } 
> } 
> Output on Harmony (Windows): 
> position = 10
> Output on Harmony (Linux): 
> position = 0

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message