Once you've extracted a section from the m3g file (lets say it's stored in a byte array called compressedByteArray) then you might invoke Inflater like this:
1 2 3 4 5
| Inflater decompresser = new Inflater(); decompresser.setInput(compressedByteArray); byte[] decompressedByteArray = new byte[32768]; decompresser.inflate(decompressedByteArray); decompresser.end(); |
And hey presto, decompressedByteArray now contains the unpacked section. (Also remember there can be multiple sections in an m3g file)
Furthermore, you might like to checkout the
M3GToolkit thread as they've produced an open-source toolkit which might have all the information you need.