android - How to save an array of floats and shorts in byte to disk in java? -
i have 2 arrays i'd save file. array of floats , array of shorts (mesh data). don't want save these characters because makes files unnecessarily large. file loaded both android , ios bytebuffer.nativeorder thing makes me nervous. suggestions, tips, warnings appreciated.
float verts[x]
short indices[y]
i'd use dataoutputstream
- write out number of vertices, vertices themselves. write out number of indices, indices.
this use big-endianness, , should easy enough read/write on ios, without worrying native byte ordering.
Comments
Post a Comment