private void parse ( String header ) { ArrayList < String > list = new ArrayList < String > ( 4 ) ; StringBuilder sb = new StringBuilder ( ) ; int index = 1 ; while ( index < header . length ( ) ) { char c = header . charAt ( index ++ ) ; if ( Character . isDigit ( c ) ) { sb . append ( c ) ; } else { if ( sb . length ( ) != 0 ) { list . add ( sb . toString ( ) ) ; sb . setLength ( 0 ) ; } } } if ( sb . length ( ) != 0 ) { list . add ( sb . toString ( ) ) ; } m_id = list . get ( 0 ) ; m_sequence = Integer . parseInt ( list . get ( 1 ) ) ; m_type = Integer . valueOf ( list . get ( 2 ) ) ; if ( list . size ( ) > 3 ) { m_subtype = Integer . parseInt ( list . get ( 3 ) ) ; } }
Parses values out of the header text .