private void parse() {
parsed = true;
languages = new ArrayList<String>();
RawField f = getRawField();
ByteSequence buf = f.getRaw();
int pos = f.getDelimiterIdx() + 1;
if (buf == null) {
String body = f.getBody();
if (body == null) {
return;
}
buf = ContentUtil.encode(body);
pos = 0;
}
RawFieldParser parser = RawFieldParser.DEFAULT;
ParserCursor cursor = new ParserCursor(pos, buf.length());
for (;;) {
String token = parser.parseToken(buf, cursor, DELIM);
if (token.length() > 0) {
languages.add(token);
}
if (cursor.atEnd()) {
break;
} else {
pos = cursor.getPos();
if (buf.byteAt(pos) == COMMA) {
cursor.updatePos(pos + 1);
}
}
}
}