Re: Why doesn't DataInputStream implement Seekable ?
- From: Yu Feng <rainwoodman gmail com>
- To: gtk-devel-list <gtk-devel-list gnome org>
- Cc: alexl redhat com
- Subject: Re: Why doesn't DataInputStream implement Seekable ?
- Date: Mon, 08 Feb 2010 13:41:55 -0500
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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]