8000330: (fc) FileChannel.truncate issues when given size > file size
Alan Bateman
Alan.Bateman at oracle.com
Sun Nov 4 02:57:28 PST 2012
On 03/11/2012 22:09, Jeff Hain wrote:
> >The webrev with the proposed changes is here:
> >
> >http://cr.openjdk.java.net/~alanb/8000330+8002180/webrev/
> <http://cr.openjdk.java.net/%7Ealanb/8000330+8002180/webrev/>
>
> position0(fd, p) is called even if position didn't change
> (was already the case before).
This is necessary because truncating the file can change the position,
Windows in particular. It could re-factored to deal with platform
specific behavior or the platform implementations could be changed to
reset the position but it hardly seems worth it.
>
> Also the exception message could be "Negative size"
> for homogeneity with map method.
This make sense - thanks.
-Alan.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/nio-dev/attachments/20121104/d1624693/attachment.html
More information about the nio-dev
mailing list