Results 1 to 2 of 2
  1. #1
    lazarus1410 is offline Member
    Join Date
    Dec 2010
    Posts
    1
    Rep Power
    0

    Exclamation String Array to a Byte Array?

    i need to convert a string array to a byte array so that i can use it to create a stream that i can add as a token to a list. The string array would contain for example, all the data in a column in a file. I now how to convert a string to a byte array. But how do i make the byte array contains all the strings in the string array? im confused :S thanks for any help!

  2. #2
    masijade is offline Senior Member
    Join Date
    Jun 2008
    Posts
    2,571
    Rep Power
    8

    Default

    Use an ObjectOutputStream wrapped around a ByteArrayOutputStream and serialise your array into that and then retreive the byte array from the ByteArrayOutputStream.

Similar Threads

  1. convert byte array to string.
    By newbiejava in forum New To Java
    Replies: 9
    Last Post: 07-30-2010, 08:00 PM
  2. String byte array
    By myka in forum Advanced Java
    Replies: 2
    Last Post: 03-18-2010, 02:33 AM
  3. String from byte array
    By justint in forum New To Java
    Replies: 2
    Last Post: 01-22-2010, 06:58 AM
  4. Search a string in a byte array
    By 2BOrNot2B in forum New To Java
    Replies: 0
    Last Post: 03-12-2009, 05:52 PM
  5. String array to byte array?!
    By Joe2003 in forum Advanced Java
    Replies: 5
    Last Post: 02-28-2009, 06:09 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •