You can replace literal 0x0A w/ constant ENTER: myPort.bufferUntil(ENTER)
0x0A
myPort.bufferUntil(ENTER)
BtW, I recommend taking a look at my Java Mode sketch example too: