public static Module loadModule ( InputStream in ) throws IOException { Module module ; DataInputStream din ; byte [ ] xm_header , s3m_header , mod_header , output_buffer ; int frames ; din = new DataInputStream ( in ) ; module = null ; xm_header = new byte [ 60 ] ; din . readFully ( xm_header ) ; if ( FastTracker2 . is_xm ( xm_header ) ) { module = FastTracker2 . load_xm ( xm_header , din ) ; } else { s3m_header = new byte [ 96 ] ; System . arraycopy ( xm_header , 0 , s3m_header , 0 , 60 ) ; din . readFully ( s3m_header , 60 , 36 ) ; if ( ScreamTracker3 . is_s3m ( s3m_header ) ) { module = ScreamTracker3 . load_s3m ( s3m_header , din ) ; } else { mod_header = new byte [ 1084 ] ; System . arraycopy ( s3m_header , 0 , mod_header , 0 , 96 ) ; din . readFully ( mod_header , 96 , 988 ) ; module = ProTracker . load_mod ( mod_header , din ) ; } } din . close ( ) ; return module ; }
Load a module using the IBXM