How to convert Byte array to String type

Discussion in 'Java' started by peeushonline@gmail.com, Apr 11, 2007.

  1. Guest

    During a project dealing with encryption and decryption in password
    based encryption, I'm facing a problem while reading a Byte array.
    When the size of the string input during the encryption is small then
    both the decryption and the string shown are correct but when the
    string is large it shows error.

    byte[] textTranslated = pbeCipher.doFinal(textInBytes);
    return new String(textTranslated);

    by using this code i'm not getting the full string when its large.
    So tell me how to convert a byte array to string and read
    successfully.
    Pls Help. Thanx in advance.
    , Apr 11, 2007
    #1
    1. Advertising

  2. wrote:
    >During a project dealing with encryption and decryption in password
    >based encryption, I'm facing a problem while reading a Byte array.
    >When the size of the string input during the encryption is small then
    >both the decryption and the string shown are correct but when the
    >string is large it shows error.


    Would that be a TimeTurnsKittensIntoCatsError?
    Or would you just like us to guess?
    <http://www.physci.org/codes/javafaq.html#exact>

    --
    Andrew Thompson
    http://www.athompson.info/andrew/

    Message posted via JavaKB.com
    http://www.javakb.com/Uwe/Forums.aspx/java-general/200704/1
    Andrew Thompson, Apr 11, 2007
    #2
    1. Advertising

  3. Martijn Guest

    Martijn, Apr 11, 2007
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kirby
    Replies:
    3
    Views:
    625
    Kirby
    Oct 8, 2004
  2. Shane Wealti

    convert byte[] to Byte[]

    Shane Wealti, Jun 13, 2005, in forum: Java
    Replies:
    5
    Views:
    42,078
    Brzezi
    Jun 13, 2005
  3. Replies:
    20
    Views:
    9,698
    licebmi
    Sep 7, 2009
  4. Polaris431
    Replies:
    8
    Views:
    738
    SM Ryan
    Dec 4, 2006
  5. M D

    convert 2 byte space to one byte

    M D, Oct 6, 2006, in forum: Javascript
    Replies:
    3
    Views:
    182
    Dr John Stockton
    Oct 6, 2006
Loading...

Share This Page