ByteArrayInputStream bais = new ByteArrayInputStream(rawTextArea.getText().getBytes());
ByteArrayInputStream bais = new ByteArrayInputStream(_textPanel.getBytes());
    private void updateRequest(int panel) {        if (_editable && panel >= 0) {            if (panel == 0) {// parsed text                _request = (Request) _messagePanel.getMessage();                _request.setMethod(methodTextField.getText());                try {                    _request.setURL(urlTextField.getText());                } catch (Exception e) {                    urlTextField.setText(_request.getURL().toString());                }                _request.setVersion(versionTextField.getText());            } else if (panel == 1) {// bean shell                _request = _beanShellPanel.getRequest();            } else if (panel == 2) { // raw text                try {                    Request r = new Request();                    ByteArrayInputStream bais = new ByteArrayInputStream(rawTextArea.getText().getBytes());                    r.read(bais);                    String cl = _request.getHeader("Content-Length");                    if (cl != null) {                        byte[] content = _request.getContent(); // read the content                        if (content == null) {                            _request.setHeader("Content-Length","0"); // update the header                        } else {                            _request.setHeader("Content-Length", Integer.toString(content.length));                        }                    }                    _request = r;                } catch (Exception e) {                    System.err.println("Error parsing the rawTextArea, abandoning changes : " + e);                }            }            invalidatePanels();            _upToDate[panel] = true;        }    }