{"action":"created","issue":{"url":"https://api.github.com/repos/openhab/openhab/issues/2382","labels_url":"https://api.github.com/repos/openhab/openhab/issues/2382/labels{/name}","comments_url":"https://api.github.com/repos/openhab/openhab/issues/2382/comments","events_url":"https://api.github.com/repos/openhab/openhab/issues/2382/events","html_url":"https://github.com/openhab/openhab/issues/2382","id":65083249,"number":2382,"title":"Working with raw byte data from binding","user":{"login":"tertuis","id":11636364,"avatar_url":"https://avatars.githubusercontent.com/u/11636364?v=3","gravatar_id":"","url":"https://api.github.com/users/tertuis","html_url":"https://github.com/tertuis","followers_url":"https://api.github.com/users/tertuis/followers","following_url":"https://api.github.com/users/tertuis/following{/other_user}","gists_url":"https://api.github.com/users/tertuis/gists{/gist_id}","starred_url":"https://api.github.com/users/tertuis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tertuis/subscriptions","organizations_url":"https://api.github.com/users/tertuis/orgs","repos_url":"https://api.github.com/users/tertuis/repos","events_url":"https://api.github.com/users/tertuis/events{/privacy}","received_events_url":"https://api.github.com/users/tertuis/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-03-29T18:22:33Z","updated_at":"2015-04-01T12:01:09Z","closed_at":null,"body":"Hi All\r\n\r\nI'm trying to work directly with the bytes received from a serial link. I got to the point of representing the received messages as bytes, i.e. item.state.toString.getBytes() will look like [-17, -65, -67, 20, 15, 3, 27]. My instance just has about 100 entries at a time.\r\n\r\nThe problem is now working with this byte array. I need to find the location of certain sequences inside, then extract the bytes that are in-between these sequences (start-stop headings for my data). There's no methods available to do this, as all of them are only available at the string level. Unfortunately the byte data falls well outside the normal UTF-8 encoding, so I cannot simply use something like string.substringAfterLast(\"X\".getBytes()) to compare with, as X in this case is not defined in UTF-8.\r\n\r\nIn essence I'd like to know if there are some tool-set available from within the Eclipse IDE to assist iwth working with bytes. I've googled a lot and till date cannot event create a byte variable in Eclipse which will have the corresponding .getBytes() value of -17. Any help is very much appreciated!"},"comment":{"url":"https://api.github.com/repos/openhab/openhab/issues/comments/88450606","html_url":"https://github.com/openhab/openhab/issues/2382#issuecomment-88450606","issue_url":"https://api.github.com/repos/openhab/openhab/issues/2382","id":88450606,"user":{"login":"9037568","id":9916473,"avatar_url":"https://avatars.githubusercontent.com/u/9916473?v=3","gravatar_id":"","url":"https://api.github.com/users/9037568","html_url":"https://github.com/9037568","followers_url":"https://api.github.com/users/9037568/followers","following_url":"https://api.github.com/users/9037568/following{/other_user}","gists_url":"https://api.github.com/users/9037568/gists{/gist_id}","starred_url":"https://api.github.com/users/9037568/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/9037568/subscriptions","organizations_url":"https://api.github.com/users/9037568/orgs","repos_url":"https://api.github.com/users/9037568/repos","events_url":"https://api.github.com/users/9037568/events{/privacy}","received_events_url":"https://api.github.com/users/9037568/received_events","type":"User","site_admin":false},"created_at":"2015-04-01T12:01:09Z","updated_at":"2015-04-01T12:01:09Z","body":"Everything depends on your original received/input string. It would help if you could provide a sample.\r\n\r\nThe string \"-17\" consists of the bytes 0x2D 0x31 0x37."}}