case 1: //ASCII
dataSegLen = EndianUtils.readSwappedInteger(in);
BufferedReader reader = new BufferedReader(
new java.io.InputStreamReader(
new SubInputStream(in, dataSegLen), "US-ASCII"));
String line;
while ((line = reader.readLine()) != null) {
gen.writeln(line);
}
break;
case 2: //binary
dataSegLen = EndianUtils.readSwappedInteger(in);
SubInputStream sin = new SubInputStream(in, dataSegLen);
ASCIIHexOutputStream hexOut = new ASCIIHexOutputStream(gen.getOutputStream());
IOUtils.copy(sin, hexOut);
gen.newLine();
break;
case 3: //EOF