starting streams at offsets

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Is there an existing means of starting a FileStream at a given offset into a file? That is, can the origin be set somewhere other than the beginning of the actual file?

As an example, let's suppose I'd like to disregard the first 32768 bytes in a file. I know I could create a normal file and just seek forward, but if I could set the origin of the stream 32768 bytes from the beginning of the file, I wouldn't have to know that offset anywhere other than the creation of the stream.

If it's not possible I'm not going to be doomed to failure, but it's something that would be handy.

Lee Crabtree
.



Relevant Pages

  • Example 4
    ... Or one wants to pass the memory stream to different classess... ... location in the buffer. ... the offset in the constructor... ...
    (alt.comp.lang.borland-delphi)
  • Re: starting streams at offsets
    ... System.IO.Stream which represents another stream starting from offset X. ... public override bool CanRead{ ... memory when it gets constructed. ...
    (microsoft.public.dotnet.framework.clr)
  • Re: uncompressing data in memory
    ... FAR from invoking undefined behaviour. ... It is *guaranteed* to work for text streams, when offset is 0. ... For a text stream, either offset shall be zero, or offset shall ... Dan Pop ...
    (comp.lang.c)
  • Multiple Stream Offsets
    ... Running into a strange problem with stream offsets. ... multiple streams (position, UVs, diffuse, etc.). ... In DX8 they all used the same offset. ... I did a search for SetStreamSource in the dx sdk samples, ...
    (microsoft.public.win32.programmer.directx.graphics)
  • Re: fseek
    ... the results of ftell on a binary stream are ... >useless/meaningless to any text stream on the same implementation. ... >by ftell on a text stream need not be a plain byte offset. ... The standard does not preclude using ...
    (comp.lang.c)