Not getting all my bytes from inout stream.

hi,
i'm writing an i-appli that interacts with a java web server. my problem is that i'm not getting all of my bytes through to the phone.
actually i'm using an emulator right now. when i use the real phone i set content length on the server side and it all goes through. but for some reason when i set content length on the server the emulator doesn't pick up anything(using i-jade emulators) bug??.
it should work though because when i print out the number from in.available() it matches with the number of bytes that i want to go through.
but when i grab the int from the read it is less than what returns from available().
here's a snippet of the i-appli code. i'm printing out TESTBYTELEN to the screen and it is less than when i set it to 'bc' from in.available. (i'm getting 3784 of 4420 bytes EVERY time)
thanks for any help
matt
========================================
HttpConnection conn = (HttpConnection)Connector.open(IPString,Connector.READ,true);
conn.setRequestMethod(HttpConnection.GET);
conn.setRequestProperty("Content-Type","text/plain");
conn.connect();
InputStream in = conn.openInputStream();
if (in == null)
throw new IOException("servlet unreachable");
bc = in.available();
streamb = new byte[bc];
TESTBYTELEN = in.read(streamb,0,bc);
in.close();
conn.close();
=========================================

Also, testing with available is not that good... it just tells you how many bytes can be read without blocking, not the amount of bytes that can actually be read. So the code should be more like:
bc = MAX_BYTES_TO_BE_READ;
streamb = new byte[bc];
int bytesread;
int off = 0;
int len = bc;
while ((bytesread = in.read(streamb,off,len) != -1) {
off += bytesread;
len -= bytesread;
(to clarify, in.read returns the number of bytes that were actually read and -1 when there are no more bytes to be read)

Similar Messages

  • Not getting all my music from iTunes I might have too much stored like ebooks how do I delete

    I have a iPod touch but have noticed I am not getting new music I purchased from iTunes onto my touch. Not sure if I have too much other things like books etc using storage, how can I correct this

    What exactly happens when you try to sync?
    Does iTunes see the iPod?
    Was the iPod previous synced to another iTunes library/computer?
    Have you successfully synced from this iTunes library/computer before?
    If so have you done anything like update iTunes on the computer since it last successfully synced?
    Do the songs play in iTunes?          
    Does any media now sync to the iPod?
    Do you have the right boxes checked to sync?
    iTunes: Syncing media content to iOS devices and iPod       
    Try syncing using the manual method                
    Managing content manually on iPhone, iPad, and iPod

  • Not getting all e-mails from Exchange server w/ OS Mavericks

    Hello all,
    After I installed OS Mavericks and opened up the mail app, only a small portion of my inbox (and other folders) populates in the app. Instead of all 50 e-mails in my inbox it is only showing 8. Looking back at my inbox on my iPhone and it still has all my e-mails. Is there anyway to fix this?
    Thanks..

    I'm having the same issue and have tried deleting the account and adding again but I only have emails that came in yesterday after Mavericks installed. My thousands of emails from the server did not load. They are everywhere else but on the updated Mavericks computer.

  • I DO NOT get ALL email messages from folks that say they sent me an email. I can get them sometimes and sometimes not.

    There are folks that send me emails all the time. Sometimes they come in and most times they don't They are always telling me that they sent me an email and I have not received it. When I tell them to send it NOW as I am sitting at the computer, then the email comes in for the first time. This has been happening since I downloaded Thunderbird. Please tell me why this happens as it if a bit frustrating, especially when they don't know I have not received their email and the information is very important that I get the email and the information they are sending me.
    Thank you for your assistance.
    barbi saunders

    Thunderbird downloads email messages that make it into your Inbox on your providers server. Are these missing messages actually in the Inbox and are not downloaded or do they not make it to the Inbox on the server.
    If the later, ask your provider where your mail is going.
    It might not hurt to log into your account on the server and check for a spam folder. You might be surprised to see what is in there.

  • Not getting all the artist from a compilation to "artists" in my iPod

    I have some compilation cds and when i import them they all (individually) get listed in artist, i ctrl marked the songs and changed it to "various artists" Is it some way of tagging the song so the "real" artist comes up when i play the song?
    should i add it to every song name or is it any easier way?

    When you changed the Artist field to *Various Artists*, you deleted the real artist name so there's othing to show up except Various Artists.
    You should have put *Various Artists* in the *Album Artist* field and left the original artist in the Artist field.

  • Cube not getting all the data from DSO

    Hi experts ,
       I have a scenario where i have 256 records in the DSO . I am loading the DSO data into Cube .but the cube is getting loaded with 200 records . Can any body help me in this regard ???
    Samir

    Hi samir,
    This might be usual because the records in the cube get aggregated. so u will not add  records in the cube but data will be updated correctly.

  • Not getting all texts on 650

    i am a newbie and i apologize in advance for my ignorance.
    i am now on my second treo 650. both have had the same problem. i am not getting all my texts from other verizon friends. on their phone it says it went though, but i never receive it. on my old phone i could take out my battery and then it would come through after the phone restarted, not so on my replacement. i am just not getting them. the sound on my sms is not working all the time either.
    i am getting a little frustrated considering i pay for texts i am not getting and i never know i am not getting them until someone asks me why i didn't respond!
    thanks in advance for any help!!!
    Post relates to: Treo 650 (Verizon)

    Hi  I just bought a Treo 650 and am not being able to receive sms with taking the battery out like you....  Did you ever figure out what was wrong??
    Post relates to: Treo 650 (Verizon)

  • How do I recover photos from my AppleTV photo stream? when I reset my iPhone, I did not get all of my photos back. How do I get these photos off of my Apple TV?

    how do I recover photos from my AppleTV photo stream? when I reset my iPhone, I did not get all of my photos back. How do I get these photos off of my Apple TV?

    Hi MrRhea,
    Welcome to the Apple Support Communities!
    It sounds like you have photos in your Photo Stream that you would like to download. The photos are not actually stored on your Apple TV, it sounds like they are being displayed from your Photo Stream. Please read over the attached article for information on your Photo Stream and how to download these photos.
    My Photo Stream FAQ - Apple Support
    Because your Mac and PC have more storage than your iOS devices, you can choose to download all of your My Photo Stream photos automatically.
    In iPhoto or Aperture preferences on your Mac, select Photos (or Photo Stream) > My Photo Stream > Automatic Import. All of your photo stream photos will import into your Events, Projects, Photos, Faces, and Places folders in iPhoto or Aperture.
    On your PC with My Photo Stream on in the Control Panel, all of your photos will import intoC:\\Users\<user name>\Pictures\iCloud Photos\My Photo Stream
    Best regards,
    Joe

  • HT201317 Not all of my photos on my iphone are showing up on the stream on my computer.  How do I get all the photos from my iphone onto my photo stream on my PC?

    Not all of my photos on my iphone are showing up on the stream on my computer.  How do I get all the photos from my iphone onto my photo stream on my PC?

    Use a third-party utility such as Phone to Mac - Pod to Mac.

  • IPhone 5 not getting all texts from Galaxy S6

    My girlfriend is having a problem not getting all of my texts. As far as we know, it is only happening to texts from my phone. They are showing as sent on the Galaxy S6, but do not show up, ever, on her iPhone 5. The missing messages are random. 

    Hi there
    I’m sorry to hear that there have been some issues with receiving texts. I’d be happy to look into this for you! Can you please send me a private message by Clicking Here and include the following information?
    Full name
    Cell number
    Recipient’s number
    Best time to call
    Thanks,
    Charise
     

  • Mail not getting all messages from server and other strange behavior

    Hello All,
    Mail has been doing some odd things for me of late (at least the last week) and I'm lost for a solution to my problem. As far as I can tell, perhaps my Prefs. have become corrupted, or at least something in relation to Mail has become corrupted. Perhaps someone has a solution to this issue before I have to back it all up and NUKE the whole **** app to get back up and running properly.
    The main issue I appear to be having is that Mail is not getting all of my Mail messages from my server. I can log into my web-mail interface provided by my domain host and can see there that there are many e-mails that don't appear to be coming down the pipe to the Mail.app client. I'm getting some e-mail's but not all....
    *Here are all the things that I've checked:*
    • The missing e-mails are not being picked up as Junk and are not in the Junk folder
    • I have done a search within Mail for the missing e-mail's and nothing turns up anywhere.
    • I have checked on the server end that I'm not maxing out my InBox or that there are any other service issues from my domain host provider.
    • I have been into Prefs and checked my account settings - most (see below) of which appear to be as normal and are fine.
    *Here are the weird things that I've noticed:*
    • When I went into the Prefs. for the account in question, I noticed that my login had changed. For example - it usually it is "[email protected]", however it had seemed to have changed to just "johndoe" - I know this wasn't me as my domain host will not allow me to access any mail unless the login is the full mail address.
    • In RULES, every rule I double click to check on seems mostly fine, apart from the fact that every "Account is:" the pull down menu just appears as blank. Usually it says "Account is: ([email protected])"
    It's there last 2 items that make me think something is corrupted - so I guess my question is, what pref or file has corrupted and how can I fix it without having to give Mail.app a digital enema?
    Any assistance would be most helpful - missing some but not all your incoming e-mail messages is quite annoying, as you can guess...!
    Thanks,
    Boz

    Hello Boz.
    This appears to be a rules issue. Mail is almost certainly downloading those messages, but they’re probably being processed by your rules in an unexpected way — given the information you’ve provided, maybe because there is something wrong with the file where the account settings are stored.
    Do you have any Mail plug-ins? In the Finder, go to each of the following folders (if they exist). What do you see there?
    /Library/InputManagers/
    /Library/Mail/Bundles/
    ~/Library/InputManagers/
    ~/Library/Mail/Bundles/
    To make accurately reporting this information easier, you may open /Applications/Utilities/Terminal, type the following command (you can just copy it here and paste it in Terminal), and press <Return>. You can then copy the output of that command from Terminal and paste it in your reply to this post:
    ls -1 /Library/InputManagers /Library/Mail/Bundles ~/Library/InputManagers ~/Library/Mail/Bundles
    <hr>
    Verify/repair the startup disk (not just permissions), as described here:
    The Repair functions of Disk Utility: what's it all about?
    After having fixed all the filesystem issues, if any, and ensuring that there’s enough space available on the startup disk (a few GB, plus the space needed to make a backup copy of the Mail folder), try this:
    1. Write down your Mail > Preferences > Accounts settings or take screen shots of them.
    2. If you have a .Mac account and .Mac synchronization of Mail data is enabled either in Mail > Preferences > General or in System Preferences > .Mac, disable it before proceeding.
    3. Quit Mail.
    4. Make a backup copy of the ~/Library/Mail folder, just in case something goes wrong while trying to solve the problem. You can do this in the Finder by dragging the Mail folder to the Desktop while holding the Option (Alt) key down, for example. This is where all your mail is locally stored.
    5. In the Finder, go to ~/Library/Preferences/. Locate com.apple.mail.plist and move it to the Desktop (to be deleted if this solves the problem). If you have a backup of your data that includes a working copy of this file, you may try restoring it from the backup to avoid steps 6-8.
    6. Open Mail. You’ll have to set up your non-.Mac accounts from scratch all over again. If given the option to import existing mailboxes or something like that, don’t. Just enter the account information and Mail will automagically rediscover the data in ~/Library/Mail/ when done.
    7. You’ll have to re-configure some of your Mail > Preferences settings. For spam-related security reasons, the first thing you should do is go to Preferences > Viewing and disable Display remote images in HTML messages if it’s enabled.
    8. As a side effect of re-creating com.apple.mail.plist, Mail might rename Outbox (which is where messages waiting to be sent are stored) to Delivered. The name of that mailbox is actually a misnomer, as it would contain messages (if any) that couldn’t be delivered for some reason. You can delete that mailbox if you wish.
    9. If the problem is fixed now and .Mac synchronization of Mail data was enabled at the beginning, enable it again, go to System Preferences > .Mac > Advanced, click Reset Sync Data, and choose the appropriate options to reset the Mail data stored on the .Mac server with the data locally stored on the computer, i.e. sync data must flow from the computer to the .Mac server.
    <hr>
    Note: For those not familiarized with the ~/ notation, it refers to the user’s home folder. You can easily locate any of the folders referred to in this post by copying the folder path here, doing Go > Go to Folder in the Finder, and pasting the folder path there.

  • My iphone has been water damaged and in the mean time ive gone back to using my old phone. But i need to get all the contacts from my iphone i had synced to my laptop, but i don't know where to find them and im not sure if ive backed them up to anything!

    my iphone has been water damaged and in the mean time ive gone back to using my old phone. But i need to get all the contacts from my iphone i had synced to my laptop, but i don't know where to find them and im not sure if ive backed them up to anything!

    If your contacts are synced to your computer then they are in the supported app you are syncing with.
    When you set up syncing of contacts on your device, which application did you select? 

  • HT1386 I want to give me old iphone 4 to my daughter and need to get all her info from her old iphone onto a new computer.  The PC she synced with is dead and she does not want to loose all her contacts and music.

    I want to give my old iphone 4 to my daughter and need to get all her info from her old iphone 3 onto a new computer.  The PC she synced with is dead and she does not want to loose all her contacts and music. How can I do this?

    To effectively transfer ownership of the iPhone requires that it be "restored" as a new device.
    ...  The PC she synced with is dead
    The iPhone is not a backup device. Your computer backs up the iPhone, not the other way around. What you use to back up your computer is up to you - Macs use Time Machine. I assume PCs use something similar.
    If her PC backup is dead you will have difficulty extracting content from the iPhone since it is not designed to work that way.
    All her Apple purchases can easily be transferred to another iPhone. However, her contacts will be gone, as will any music or other contact obtained from sources other than Apple.
    There are a number of third party utilities that claim to be able to extract content from an iPhone. See wjosten's procedure here:
    https://discussions.apple.com/docs/DOC-3141

  • Help:  Not getting all data from text data type

    Hi there
    I have a stored procedure that returns a couple of fields and one of the fields is of datatype TEXT. In my ResultSet, I do not get all the data back that is stored in the TEXT datatype. I have say about 600 charactors in this field, but only 30 charactors are returned. Is there a reason why this is happening and how can I fix it?
    Please help?
    Thanks

    I set that field to have a normal string of about 50 charactors. Namely: "this is a note that is about 49 charactosrs long." (exclude the quotes). And I still got 30 charactors back only.
    I set a shorter text value of 21 charactors and that returned all 21 charactors.
    The text that is usually in this field is:
    "URL=SubsidiaryNarrative.html�BABY_CARE_PRODUCTS=false�AIDS_FOR_PHYSICALLY_DISABLED=false�SPORT_SUPPLEMENTS=true�NATURAL_REMEDIES=false�COSMETICS_FRAGRANCE=false�WOMANS_HEALTH=false�ADDITIONAL_CARDS=No�EXERCISE_ROUTINE=Yes�NUMBER_OF_CHILDREN=0"
    And I got out "URL=SubsidiaryNarrative.html�B"

  • Since I downloaded the most recent version of iOS, my iPad and iPhone do not have all the music (from CD's) anymore that I have on our home computer iTunes Library.  How can I get all our music onto the music libraries on the iPhone and iPad? Thanks!

    Hi
    Since we downloaded the latest version of iOS on our iPad and iPhone, and synchronized our music collection in the Cloud, we can no longer see on our iPad and iPhone the music from our CD's that we have on our home computer's iTunes library.  We can only see music in the iPhone and iPad library that have been purchased on iTunes.  How can we get all our music from our computer's iTunes librbary visible on the iPhone and iPad?  Thanks, Nick

    Resync from your computer.
    iOS: Syncing with iTunes - Support - Apple
    If your having trouble syncing, come back and let us (fellow users) know.

Maybe you are looking for