How many bytes can the string

Hi,
I have the problem to create the String with the lenght longer than 2 MBytes.
For instance :
byte[] b = new byte[10*1024*1024);
len = b.length;
String s = new String(b,0,len);
Any helps are appreciated.
PS: Pls assume b contains a data e.g. 7*1024*1024 and has the length of 7*1024*1024, everthing is ok until the String can not be instanstiated.
Regards
Paulus

I have the problem to create the String with the lenght longer than 2 MBytes.What do you mean - what kind of problem? This works just fine:public class test {
    public static void main(String args[]) {
        byte[] b = new byte[10 * 1024 * 1024];
        for (int j = 0; j < b.length; j++) {
            b[j] = 97;
        String s = new String(b) + "b";
        System.out.println(s);
}(although running did require setting the max. heap size bigger... :)

Similar Messages

  • How many characters can a String hold?

    How many characters can a string hold, and can i give the value of a JTextArea to a string? Thanks -

    well, you could try it, it should only take a few lines of code to see how large a String can get.
    I think a String can be larger than the text of a JTextArea, not sure though.

  • How many times can the photoshop code be used?  Like can I download it on one computer then later download it on a different computer?

    Basically the title explains my question.  How many times can the photos hop code be used?  Like can I download it on one computer then later download it on a different computer?

    You're allowed two installations/registrations. Anything above that requires deregistration on one of those computers.
    Take note that if this is Photoshop CC, it's as easy as signing out on a system; there aren't any serial numbers involved as it's all tied to your Adobe ID.

  • How many contacts can the iPhone hold....now?

    This question was asked back in 2008 and has been archived, however I'd like to revisit this issue.
    What I'd like to know, is this:
    How many contacts can the iPhone hold before it effects performance?
    I have a iPhone user with an MS Exchange email account on the phone, Calendar and Contact sync is turned on. The problem is, the user has 10,000 contacts.
    The contacts synchronized to the iphone, however, when writing emails or doing any task that accesses the contacts database (i.e. auto-completion of names), There is a good 35 to 40 second lag before you can enter the second letter of a name on the keyboard. I can only assume that this is due to the pure insanity of having 10,000 contacts on a mobile device... The search takes too long. Although it did work just fine on the blackberry (a lessor device ).
    Can anyone tell me if there is a limit on how many contacts one can successfully store on an iPhone without running into the "lag" issue?
    Thanks in advance.
    Nigle

    What is the overall size of all these songs?
    This will determine how many songs the iPhone can hold.
    The actual capacity of an 8GB iPhone is around 7.3 GB - OS X alone takes up approximately 500MB.
    You should leave some free space available on the iPhone for general operating purposes and if you access any email accounts and for Safari cache purposes, etc.
    So you have around 7GB available - as long as the overall size of all 9400 songs isn't greater than 7GB or so, you are covered.

  • How many decibels can the iPod Shuffle (4th generation) go up to?

    Hi! How many decibels can the iPod Shuffle (4th generation) go up to?

    Hi pce55,
    If you have questions about iPods and sound or decibel output, you may find the following pages helpful:
    Apple - Sound and Hearing
    Q. How can I set the Volume Limit on my iPod to a specific decibel level?
    A. The Volume Limit setting lets you change the maximum output of your iPod’s headphone jack. The actual sound pressure level that you experience depends on several factors: the music you’re listening to, how it was recorded and encoded, the type of earbuds or headphones you use, and their placement in your ears.
    Apple - Sound and Hearing FAQ
    Regards,
    - Brenden

  • How many songs can the ipod touch 64 g hold?

    How many songs can the ipod touch 64 g hold?

    About 7,000 songs in 128-Kbps AAC format
    Note that 128 is slight compressed compared to normal songs.

  • How many colours can the ipod touch 2g can display?

    how many colours can the ipod touch (2g) can display?

    The Apple specs don't say.
    Why does it matter with so small a screen?

  • I work in schools and would like to know what if a school opens an iTunes account to purchase apps, how many iPads can the same app be loaded onto legally?

    I work in schools and would like to know if a school opens an iTunes account to purchase apps, how many iPads can that app be loaded onto legally?

    One iPad per purchase, assuming the iPads will be used by different users. If the school wants to purchase an app for multiple iPads, they have to have one license for each iPad. In the US, there's an academic volume purchase plan:
    http://www.apple.com/itunes/education/
    Regards.

  • How many clients can the time capsule handle?

    I'm trying to research how many clients can be accomodated by the time capsule - anyone know?

    Welcome to the Apple Support Communities
    You can connect 50 devices and computer wirelessly to the Time Capsule, but you can connect more through Ethernet

  • How many movies can the itunes library hold?

    i have quit a few on there, and i want to keep them on there, aswell as add more. i'm just worried that if i go to buy a movie it'll say it can't hold anymore movies

    how many movies can the itunes library hold?
    As many as the available drives will accomodate.
    (47294)

  • UCCX 10.5 - How many calls can the CUIC database hold?

    I have a 10.5.x 100 user deployment of UCCX (30 user licenses) and was wondering if there is a way to tell how many calls (roughly) it will be able to store before it starts purging old data.  I've found the purge settings (90 months / 80%) but I don't know how to tell how many calls it takes to get to 80% of database capacity.  Has anyone found any documentation on this?  
    Also, is there a way to tell how large the CUIC database has grown (and what the max size is)?  If I can find these two things out I can make my own calculations.  

    Hi Kyle
    I hadn't seen it, but knew there must be...
    from CLI:
    show uccx dbserver disk
    This appears to show the various informix databases and their files. I'm no Informix expert, but if I apply what I know about database servers generally then I'd interpret it like so:
    - Total Size = The allocated size of the files on disk. i.e. what it can grow to.
    - Free Size = Portion of that file that is unused
    - Filename = You'll be interested in the db_hist.dbs line - the historical DB.
    - Data size = will be total size-free size.
    The data will grow into the file, and when it reaches the percent (of total size) set on the purge schedule (or the data in the DB reaches the months threshold) it will get purged out.
    Regards
    Aaron

  • How many songs can the Iphone hold?

    I dont know. i want to download 9000 songs plus 400 songs. Will it hold??

    What is the overall size of all these songs?
    This will determine how many songs the iPhone can hold.
    The actual capacity of an 8GB iPhone is around 7.3 GB - OS X alone takes up approximately 500MB.
    You should leave some free space available on the iPhone for general operating purposes and if you access any email accounts and for Safari cache purposes, etc.
    So you have around 7GB available - as long as the overall size of all 9400 songs isn't greater than 7GB or so, you are covered.

  • How many photos can the Aperture Library hold ????

    Just trying to work out the limits for photos for Aperture ? How many photos do you folks have in your libraries ? 
    Cheers Darren

    As you get close to 750,000 you begin to run into problems with administrative tasks taking too long.  Repair and Rebuild will take days, not hours.  Upgrading a Library that large is also better measured in days than in hours.  The longest operation I've done took 82 hours.
    Because of my time limitations (not the computer's) I did not grow this test Library beyond 750,000 Images, which I consider, as a rule-of-thumb, the practical limit for an Aperture Library running on c. 2014 equipment.  (YMMV — a lot of variables in there.)
    Just for some sense of scale, if you looked at each Image in a Library with 750,000 Images for 1 second and never blinked or paused, it would be more than 8 ½ days until you'd "seen" all of them.  (750000 /60 /60 /24, or just put "750000 seconds is how many days?" into Google for an impressive use of their built-in converter.)

  • How many films can the ipod carry

    Hello,
    is their an amount of how much is dedicated to films alone.
    I have a few films to add but my ipod 80gb does not eccept all
    Do ihave to change any settings for it to be larger on having movies?
    thank you for a quick responce i am going on holiday and wanna take six films
    3gb
    kad

    obviously it depends on how long the films are and how they are compressed. the ones it does not accept could be because they are not in mp4. i should think it should take 6 quite easy as I have a 30 gb with 3000 tunes and 4 films and still space.

  • How many songs can the ipod shuffle hold

    I have about 250 songs and I just need to know how many songs this will hold

    The 2GB iPod shuffle should hold about 480 songs (based on 128 kbps AAC files at 4 minutes per song).

Maybe you are looking for

  • Encoding for content in KM

    Hi All, I'm modifying and updating an existing file in KM. I use DOM to parse the file and update it as follows: Element rootElem = doc.getDocumentElement(); <code to update rootElement> Finally, I want to convert the Document or rootElement to ICont

  • Changes are not updated from ECC to CRM How to debug

    Hi, QCs 1140049726  and 1140047459 were updated in P20 system to remove the WBS.  This was done per normal P20 process and instructions.  P20 system correctly reflects that QCs have no WBS value and the contracts are BOX - all is correct in P20. CSP

  • IDVD - PAL - NTSC - REGIONS; All messed up?

    So I finished a project on iDVD, and the "clients" are from many different countries... The original project was worked as PAL. In the end, in iDVD I changed the setting to NTSC in order to write 3 disks. 1 for a client in Canada, and 2 for the U.S.

  • Swf analysis

    I'm rather new to macromedia flash 8 and need some assistance in modifying a swf file. This swf file has embedded in it a url that we need to change, and I could use some advice on how to go about it. I have the 30 day trial version of flash 8.

  • EA4500 Hang

    I could use some help troubleshooting a recurring, intermittent problem with my EA4500. It will hang every once in awhile. No discernable pattern, sometimes goes for a month without an issue, sometimes happens twice a week. It does not seem to be rel