[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gtk-devel
Subject:    Re: Why doesn't DataInputStream implement Seekable ?
From:       Yu Feng <rainwoodman () gmail ! com>
Date:       2010-02-08 18:41:55
Message-ID: 1265654515.16280.9.camel () localhost ! localdomain
[Download RAW message or body]

Hi, this topic was about one year ago.

Is there any progress on a Seekable BufferedInputStream since then?
Is it possible to simulate a seek by immediately calling
g_buffered_input_stream_fill after g_seekable_seek on the underlying
FileStream?


Regards,


Yu



> n Mon, 2008-12-08 at 22:37 +0100, Martin Olsson wrote:
> > Hi,
> > 
> > I'm wondering if there was any particular design rationale behind GLib not
> > implementing the Seekable interface on the class DataInputStream?
> > 
> > If there is no particular reason, then I would like to file a feature request
> > to get Seekable into DataInputStream or one of it's base classes.
> > 
> > I'm parsing a big file and I would like to seek to one specific location,
> > read some data and then seek to a second location and read some data from
> > there as well. As a workaround I tried to seek on the underlying 
> > FileInputStream
> > that I passed as a parameter to the DataInputStream constructor but this
> > hack didn't work reliably.
> 
> The reason that is not reliable is that GDataInputStream inherits from
> GBufferedInputStream, and the buffer it has causes issues with the seek.
> 
> However, i don't think there is an inherent problem with implementing
> seek in GBufferedInputStream (if the underlying stream supports it).
> Would be a nice addition.
> 
> 
> _______________________________________________
> gtk-devel-list mailing list
> gtk-devel-list@gnome.org
> http://mail.gnome.org/mailman/listinfo/gtk-devel-list

_______________________________________________
gtk-devel-list mailing list
gtk-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-devel-list
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic