Maximum size of a file that  the getResourceAsStream() can read?

hi guys.before i post this new topic, i have search through the forum,and google. on the web .so reply are appreciated.
1) getResourceAsStream() method, is there a way to know the maximum size of a file that the getResourceAsStream() can read?
InputStream          is = getClass().getResourceAsStream("Dream2.gif");
                              byte[]               byte0          = new byte[10 * 1024];
bcos the size of my bytearray is hardcoded, if any thing is greater than that size ,my program would crash.so i would like to know if there is a way to do that
2)if that is not available, are there any methods in j2me using any connection (http or socket),that can know the maximum size of the file that are available??????

You won't be able to tell how big the resource is using this approach. However, since your resource is in the JAR you will be able to know the size of it before hand.
Otherwise, use the read(byte[], int, int) method to read the resource in chunks like this:
int count = 0;
byte[] bytes = new byte[1024];
while ((count = read(bytes, count, 1024)) != -1) {
  // do something like write to a ByteArrayOutputStream
}Although redundant, using this approach you can see that you can keep a count of the number of bytes you've read and thus know the total size of the resource.

Similar Messages

  • How do you add cue points to a MOV file that Director 12 can read?

    I have just downloaded the Trial of Director 12 - and unless I can add cue points to video that it can interpret - I am not going to be able to achieve what I need to.  I've spent the last day and a half looking over the scant documentation provided by Adobe, and anything else I could find online - but the only answers that came anywhere near were for old versions using discontinued xtras.
    Please can anyone help? - I am using Windows 7 64 bit - CS6.
    Thanks in advance. :-)

    Probably too late for your project but...
    You can do this by using 3 sprites in addition to the SWF. In this example, I've named them "videoPlay", "videoRewind, and "videoStop". The SWF in this case was named "video."
    Apply this script to each of the 3 sprites.
    property mySprite
    on beginSprite me
      mySprite = sprite(me.spriteNum)
    end
    on mouseUp me
      case mySprite.name of 
        "videoPlay":
          sprite("video").play()
        "videoStop":
          sprite("video").stop()
        "videoRewind":
          sprite("video").stop()
          sprite("video").rewind()
      end case
    end

  • Maximum size of XML files and number of IDocs for IDoc receiver adapter

    Hi Guys,
    We have an XML file to IDoc scenario where XI picks up an XML file with multiple Customer records in it, it does a simple mapping and creates one DEBMAS06 IDoc per record in the XML file. All IDocs are sent in a single file in XML-IDOC format to IDoc adapter which then posts the separate DEBMAS IDocs to R/3.
    a) What is the maximum size of XML files that XI can handle with mapping involved ?
    b) What is the maximum number of IDocs in a single file that the receiver IDoc adapter can handle ?
    The first time this interface runs almost 200,000 Customer records will be exported in one XML file.
    Thank you.

    Hi,
    Well it is difficult to find out the  maximum Size of xml messgaes that can be processed by XI and also Maximum number idocs an recevier Idoc adapter can handle.
    This totally depends on your production system loads and the limits can be set totally on trail & error basis..
    In my heavy loaded production system, i found out that the maximum size of the successfull messages after processing by XI is around 75 MB (seen in transaction SXMB_MONI). Whereas messages with size around 100 MB went into error.
    I havent encounter any such limits with respect to Idocs.
    I would suggest that you divide your data into smaller chunks and sent it part by part instead of sending it all once since you data size is huge.
    You can vary your batch size as per your system load.
    Regards,
    - Deepak.

  • What is the maximum size of a jpg that can be imported into iPhoto?

    what is the maximum size of a jpg that can be imported into iPhoto

    I've imported and worked on Photoshop and tiff files up at 220 MB (8400 x 6600 pixels) in size.  It does take some time to do any edits, up to 7 seconds for some.   220 MB is a big file but iPhoto handles it OK.
    I do have a top of the line iMac with SSD drive so it's pretty fast.  Other Macs may be slower depending on their configuration.
    OT

  • The maximum number of data files that can be accessed on the ORACLE DB is r

    Hello Gurus,
    We are facing problem in our BW production server
    The maximum number of data files that can be accessed on the ORACLE DB is reached
    Error Message :
    ORA-00059: maximum number of DB_FILES exceeded
    We have search a SAP Note regarding this error but this is for oracle - 8i, we want to solve this problem in Oracle - 10g
    Thanks & Regards
    Shishir
    Vital Information
    Database - ORACLE - 10.2.0.2.0
    O/S - AIX - 5.3
    SAP - BIW ( 700 )

    Hi,
    check Data transfer from one BW system to another
    regards,
    kaushal

  • Maximum size for JAR files on Nokia 3120 Classic

    I am trying to download and install a java app for a Nokia 3120 classic, but when installing I get an error message telling me that the file is too big at 5.7mb.
    I can't find the maximum size of .jar files for this phone anywhere.
    Can anyone let me know what this is and whether there is any way to get the app to work.
    Many thanks.
    Alan Watson

    YES THERE IS A WAY!! I only got this information from someone else. Thanks for that person.
    Here are the steps:
    1. Download the jar file you want to install, to your computer. Now open My computer, and on the upper left corner you shall see a menu, click the "Tools" button and then click "Folder options..." A little window will appear. Click the "View" tab. On this window you need to find an option "Hide extentions for known file types" below "Advanced settings". Then unmark or uncheck the box.
    2. Now when you open my computer and go to the folder where you had downloaded the java file, the file name will read "(anyfilename).jar". HERE IS THE TRICK.
    3. Rename the last part of your file. Instead of .jar change it to .jpg so that it reads  "(anyfilename).jpg"
    4. Now copy the renamed file and paste it in your mobile's C: or Memory Card drive.
    5. Once you had pasted, rename the copied file back to what it was. i.e "(anyfilename).jar"
    BASICALLY the phone limits a file with a ".jar" extention, you can fool it by renaming the extention to ".jpg" and then once the file is copied into the phones C:drive you can change the extention back to ".jar" by renaming it.
    Share it. Hope it works for you! God bless...
    Only One Life Twill Soon Be Past.
    Only What's Done For Christ Will Last.

  • Maximum size of upload file using Cross Domain Library

    Hi All 
    I need to know what is the maximum size of file that I can upload using Cross Domain Library from my Provider hosted app. I know that in msdn it is written that usign REST call we can upload upto 2GB but I have doubts if it is true with Cross domain library
    REST Calls. Please suggest.
     spExecutor.executeAsync(
                                   url: fileCollectionEndpoint,
                                   method: "POST",
                                   contentType: "application/json;odata=verbose",
                                   body: filedata,
                                   binaryStringRequestBody: true,
                                   headers: { "X-RequestDigest": $("#__REQUESTDIGEST").val(), "accept": "application/json;odata=verbose" ........
    And Can I pass ArrayBuffer directly or I need to pass only binary string ?
    Thanks in Advance 

    Hi,
    According to your post, my understanding is that you want to know the Maximum size of upload file using Cross Domain Library.
    Per my knowledge, you can upload files up to 2 GB with the REST API. 
    You can refer to:
    How to: Upload a file by using the REST API and jQuery
    In addition, you can pass ArrayBuffer directly. Please refer to:
    FileCollection methods
    Thanks,
    Linda Li                
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Linda Li
    TechNet Community Support

  • How do I set a fixed page size in Muse so that the window always stays the same size

    how do I set a fixed page size in Muse so that the window always stays the same size

    Hi Aish & thanks for responding;
    I would like the window size to stay the same for the entire site and not be
    able to scale to drag & scale it. ie 950 pixels x 500 pixels.
    Thanks,
    JB
    On 12/4/14 3:30 PM, "Aishvarya Raj Rastogi" <[email protected]>

  • How can I know the name of the file that the user has currently open ?

    Hello
    I'm developing a module for x3dv.
    http://hiperia3d.blogspot.com/search/label/X3DV%20Module%20For%20Netbeans
    I am going to add a button to open the files when I click it.
    I just need to know how can I know the name of the file that the user has currently open in the editor. What variable holds it in Netbeans?
    Thank you
    Jordi

    If you are using the JFileChooser to open the document, I would create another class with this included:
    //initiate class variables
    private File f;
    //create JFileChooser
    JFileChooser fc = new JFileChooser();
    fc.setMultiSelectionEnabled(false);
    fc.setFileSelectionMode(JFileChooser.FILES_ONLY)
    //set the chooser to initialise File f with the file selected
    int status = fc.showOpenDialog(null);
    if (status == JFileChooser.APPROVE_OPTION)
         f = fc.getSelectedFile();
    public File getFile()
         return f;
    }

  • Oracle apps are producing XML output in the C Mgrs that the user can't read

    Hi all,
    please help on the below issue.
    Oracle apps (AP & others) are producing XML output in the Concurrent Managers that the user cannot read. There are two flavors, as an error message: The XML page cannot be displayed Cannot view XML input using XSL style
    sheet.
    The following tags were not closed: XLAACCPB, LIST_APPLICATION. Error processing resource ''https://xxxxxxxxxxxxxxx... as well as the XML text itself: - 200 Payables 200 Payables Y 1 xxxx US EXPENSE GL 2011-07-15T00:00:00.000+00:00 N No Y Y N D No Detail Y Yes Y N No - - 200 Payables - - 95293 The journal import request 39073188 has failed for the ledger xxxx US EXPENSE GL.
    Thanks in advance
    Kumar

    please help on the below issue.Please post the details of the application release, database version and OS.
    Oracle apps (AP & others) are producing XML output in the Concurrent Managers that the user cannot read. There are two flavors, as an error message: The XML page cannot be displayed Cannot view XML input using XSL style sheet. What is the exact/complete error message?
    Please check the OPP log file for details about the error.
    Troubleshooting Oracle XML Publisher For The Oracle E-Business Suite [ID 364547.1]
    Unable to Display XML Page - "Cannot view XML input using XSL style sheet" [ID 730610.1]
    Unable To Review XML Output From Application : "Cannot view XML input using XSL style sheet" [ID 437749.1]
    Thanks,
    Hussein

  • How to organise Lightroom catalogue, in such a way that the catalogue can be used on another comput

    how to organise(and save) Lightroom catalogue, in such a way that the catalogue can be used on another computer? / so you can see what has been edited etc. /

    Yes, but external disks will always be slower than internal drives.
    Look into file synchronization software. As long as folder structure is identical inside the two master folders, and drive letters the same, you can keep the two machines fully synchronized very easily, going both ways. The one I use cost about $50 or so.
    Use a large capacity 2,5" portable (goes in your pocket) for transport. You need the entire master folder there, but once set up only new or modified files are copied.
    The Lightroom catalog can be synchronized with the rest, so that you are working with the same catalog on both machines. This overwrites the catalog with a new copy every time, so a regular backup schedule in addition is a must. OTOH you will have three copies of every file, one always off-site. That's sound backup practice.
    Tip: exclude the Lr Previews folder from the synchronization. They are written to disk in such a way that they take an insanely long time to copy. New previews will be built on the receiving machine.

  • I have problem with buying in games , I got the massage that the purchased can not be completed , please contact iTunes support.. I need help for my case please

    I have problem with buying in games , I got the massage that the purchased can not be completed , please contact iTunes support.. I need help for my case please

    http://www.apple.com/support/itunes/contact/

  • Hi i have an ipod 4th gen. the problem is when ever i try to sync my iPod to my computer a mesage comes up and says that the ipod can't be backed up. There wasn't a problem until I upgraded the software. How do I fix this??

    Hi i have an ipod 4th gen. the problem is when ever i try to sync my iPod to my computer a mesage comes up and says that the ipod can't be backed up. There wasn't a problem until I upgraded the software. How do I fix this??

    Try here:
    iOS: Troubleshooting backup issues in iTunes

  • I am creating a web form from a template and I need to change a field. It is just a text field at the moment but I need to change it to a field that the customer can fill in. How do I do this?

    I am creating a web form from a template and I need to change a field. It is just a text field at the moment but I need to change it to a field that the customer can fill in. How do I do this?

    See this thread:
    http://answers.acrobatusers.com/Is-add-instructional-text-text-field-disappear-clicked-q19 5078.aspx

  • Windows Server 2012 Foundation, in a Workgroup - "The server did not finish checking the license compliance. If the server is joined to a domain, make sure that the server can connect to a domain controller"...

    Every few days we see two dialogs with the following messages:
    Dialog 1, title: Check for Licensing Compliance is Incomplete
    The server did not finish checking the license compliance. If the server is joined to a domain, make sure that the server can connect to a domain controller.
    Dialog 2, title: Check for Licensing Compliance is Incomplete
    The server did not finish checking the license compliance. If the server is joined to a domain, make sure that the server can connect to a domain controller. If the license compliance check cannot be completed, the server will automatically shut
    down in 8 day(s) 23 hour(s) 0 minute(s).
    The server is not (and never has been) joined to a domain or had any DC roles installed. In fact its still connected to the default Workgroup.
    The server was configured in our office and never showed this message until it was installed on site. The main difference from what I can see is that when installed on site it was given a static IP address and does not have any DNS settings in the network
    adapter properties. 
    I have scoured a number of forums on this error but in almost every other instance of this error message the servers are connected to a Domain Controller and the solutions generally are linked to dis-joining and rejoining the domain. Unfortunately this is
    not an option for this scenario.
    I initially thought that adding some relevant DNS server IP address may resolve the issue, however, we have the exact same model server configured exactly the same running at a different site that does not experience this problem. This server also has no
    DNS server configured.
    I have seen a post that suggests turning off the servers "Foundation Checking", but I'm unsure how to do this.

    Thanks for your response Vivian.
    I can confirm that this server is not (and never has been) a member of any active directory, it is configured as a Workgroup server. It was initially configured on a network that does have an active directory, but was never joined to it. During that time it
    never displayed these messages.
    The server was moved into production on a different site and network and setup with a static IP address.The site network does have its own active directory but the server was not joined to it. It is whilst on this new network that these messages began.
    Since my original post DNS servers have been added and the Microsoft activation has been verified, however, the messages are still appearing.
    There are only 2 user accounts configured on this server. The local admin account and another local admin user.
    The remote desktop services roles have been installed but not yet configured. I don't think that has any bearing on this scenario though.
    The description of this error in the above "Introduction to Windows Server 2012 Foundation" link states:
    This error occurs when the server cannot finish checking the requirements for the root domain, forest trust configuration, or both. It usually happens when the server cannot connect to a domain controller. If the situation persists, the server will
    shut down 10 days after the first time the compliance check failed. Each time this error message occurs, it will state the actual time remaining before the server will shut down. If you restart the server after it has shut down because of non-compliance, the
    server will shut itself down again in 3 days.
    The above description leads me to the following question - In a Workgroup environment, does the server still try to contact a domain controller to establish a level of trust? If this is the case could it be that the server can no longer see the initial DC
    on its new network and this is what is triggering the messages?
    Am I clutching at straws here?

Maybe you are looking for