I currently have things staged as follows with each
step dependent on the success of the previous step:

1. read in file tag and check for compatibility
(currently 12bytes)
2. read in header fields that describe how many
vertices, triangles, and breaklines follow (24 bytes)
3. read in vertices (n*24bytes)
4. read in triangle table (n*12bytes)
5. read in breaklines ( n*((m+1)*2bytes) )
6. read in boundaries ( n*((m+1)*2bytes) )

The vast majority of data for a tin of any complexity
will occur in steps 3&4 and could range from kilo to
giga class size.

I could probably combine stages 1&2 into one section
and the rest of the stages into a second section, but
code readability might suffer.

--Christopher

--- Paul Austin <[EMAIL PROTECTED]> wrote:

> Christopher,
> 
> Are you wrapping a large buffer (e.g. 4kb) or are
> you wrapping each 
> series of bytes (e.g. 8 bytes for a long). If you
> are doing the second 
> way, wrapping in a ByteBuffer will be inefficient
> compared with 
> DataInputStream.readLong(). As it has to first
> allocate the buffer and 
> then do the actual creation of the long, where as
> the DataInputStream 
> just takes each byte and does some shifts and adds.
> 
> Paul
> 
> Christopher wrote:
> > The way I am currently using ByteBuffer, I can
> deal
> > with any InputStream or OutputStream and switch
> > endianess by changing two static final variables
> > (BYTE_ORDER and CHAR_SET). Using a byte array to
> read
> > to and write from the stream, I just do a
> > ByteBuffer.wrap(byteArray).order(BYTE_ORDER) to
> make
> > things ordered the way I want. I've tested this
> with
> > both Big and Little Endian ordering and seems to
> work
> > just fine.
> >
> > --Christopher
> >
> >
> > --- Paul Austin <[EMAIL PROTECTED]> wrote:
> >
> >   
> >> I would use big endian as it's the Java standard.
> >> This would then make 
> >> it easier to read/write the files from
> >> Input/outputStream (see 
> >> DataInputStream) as ByteBuffer would only allow
> you
> >> to do the endian 
> >> conversion for file access. You may want to use
> an
> >> Input/outputStream 
> >> stream to read/write data in a web service.
> >>
> >> Paul
> >>
> >> *Paul Austin*
> >> /President/CEO/
> >> Revolution Systems Inc.
> >>
> >> +1 (604) 288-4304 x201
> >> www.revolsys.com <http://www.revolsys.com>
> >>     
> >
> >
> >       
> >
> >
>
-------------------------------------------------------------------------
> > Check out the new SourceForge.net Marketplace.
> > It's the best place to buy or sell services for
> > just about anything Open Source.
> > http://sourceforge.net/services/buy/index.php
> > _______________________________________________
> > Jump-pilot-devel mailing list
> > Jump-pilot-devel@lists.sourceforge.net
> >
>
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
> >   
> >
-------------------------------------------------------------------------
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services for
> just about anything Open Source.
> http://sourceforge.net/services/buy/index.php>
_______________________________________________
> Jump-pilot-devel mailing list
> Jump-pilot-devel@lists.sourceforge.net
>
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
> 




      

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Jump-pilot-devel mailing list
Jump-pilot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel

Reply via email to