Another choice is to use '\n' as the terminator and check each line to see if (c.startsWith("??MYSQL??")).