Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!feeder.erje.net!eu.feeder.erje.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Robert Klemme Newsgroups: comp.lang.java.programmer Subject: Re: offsets in a FileChannel ... Date: Sat, 23 Feb 2013 21:22:58 +0100 Lines: 27 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net MxoHC9aSgqaX593gd9k30Qr/+bkKOu3WCzhLb4m33EblyBm0RXeVRHngeyezOEJws= Cancel-Lock: sha1:djIYwI2OLyMa/C5CY3LEWNvy8ow= User-Agent: Mozilla/5.0 (Windows NT 6.0; WOW64; rv:17.0) Gecko/20130107 Thunderbird/17.0.2 In-Reply-To: Xref: csiph.com comp.lang.java.programmer:22473 On 23.02.2013 15:54, qwertmonkey@syberianoutpost.ru wrote: >> ... You would have to create more complex code if you want to align char > position and byte position. > ~ > but then why do they have a: > ~ > docs/api/java/nio/channels/FileChannel.html#position() > ~ > in the API? How/What is it used for? http://docs.oracle.com/javase/7/docs/api/java/nio/channels/FileChannel.html#position() > ~ > If you read the FileChannel.position() as you read off the chars from the > CharBuffer you always get 0 (as if the offset pointer in the underlying > FileChannel would not advance) Probably because you are not reading through the channel but mapping the file into memory. Please stop ripping your posting threads apart. Thank you. robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/