From your limited description, it sounds like you want to retrieve text from a JTextArea
in the form of bytes.
This is straight-forward enough:
byte[] data = yourTextArea.getText().getBytes("charset-name");
Replace "charset-name"
with your preferred character set.