Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public byte[] getByteArray(String data) {
- ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
- DataOutputStream out = new DataOutputStream(byteArrayOutputStream);
- try {
- out.write(data.getBytes());
- byteArrayOutputStream.flush();
- byteArrayOutputStream.close();
- } catch (IOException e) {
- e.printStackTrace();
- }
- return byteArrayOutputStream.toByteArray();
- }
Advertisement
Add Comment
Please, Sign In to add comment