protected void readInitialHeaders ( ) throws IOException { String line ; while ( ( line = readCRLFLine ( ) ) . length ( ) != 0 ) { int colonIndex = line . indexOf ( ' ' ) ; // does it have a ':' separator if ( colonIndex == - 1 ) continue ; String tagName = line . substring ( 0 , colonIndex ) ; String value = line . substring ( colonIndex + 1 ) ; if ( value . toLowerCase ( ) . endsWith ( "<br>" ) ) value = value . substring ( 0 , value . length ( ) - 4 ) ; IcyTag tag = new IcyTag ( tagName , value ) ; addTag ( tag ) ; } }
Assuming we re at the top of the stream read lines one by one until we hit a completely blank \ r \ n . Parse the data as IcyTags .