I can't resolv a problem, please help me...
Hi,
The problem is in this code, I try create a Text File with bytearray, but the result doesn't expected :
The problem is on the part of sale.write(body).
I don't received the text correct in the file. The description of the problem is before the code. Please help me, with that problem.
Code:
javax.jms.BytesMessage bytesMessage = (javax.jms.BytesMessage) aMessage;
try
while (true)
int numBytesRead = bytesMessage.readBytes(buffer);
if (numBytesRead == -1)
break;
byte[] tmp = new byte[body.length + numBytesRead];
System.arraycopy(body,0,tmp,0,body.length);
System.arraycopy(buffer,0,tmp,body.length,numBytesRead);
body = tmp;
try
java.io.File file = new java.io.File("paso0409.txt");
java.io.FileOutputStream outputStream = new java.io.FileOutputStream(file);
java.io.DataOutputStream sale = new java.io.DataOutputStream(outputStream);
for(int i = 0; i < body; i++){
sale.write(body);
catch(java.io.IOException jaio)
catch (javax.jms.JMSException jsme)
The file, show me the next text:
qS ��ISO8859-1 � ������EDI_DC40
but the correct text is only ("EDI_DC40"), blank spaces and other text.
How I do, to see only text and not see bytes character ??
Thank's to help me !!
Hervey P.
Is the line:
for(int i = 0; i < body; i++){
really supposed to be:
for(int i = 0; i < body.length; i++){
Assuming that's right, one problem I see is the method DataOutputStream.write(byte[] bytes) writes the whole array, but you have a loop that writes the same data body.length times.
On the other hand, it you are going to write a byte array to a file, then you can use the FileOutputStream directly, without using a DataOutputStream.
Your post does not show how the byte array body gets filled. My guess is that's where your problem lies. You might try putting a line in somewhere to display what the contents of the body array is.
System.out.println(new String(body));
should show you the character interpretation of the array of bytes.
Similar Messages
-
my iphone is on recovery mode and i can´t turn on it, when i try to recover it from itunes i get: unknown error (36), i´ve tried to do lot of things but i can´t solve my problem. please help!!
Hi, i had the same problem. Try to find the file "apple" or "itunes" don't know it anymore exactly. Ahm well you need to delet any information or just plug in your iphone into an other computer. important is that your iphone never has been pluged in this computer before. This was what i did, and it worked!
-
Hi .. my iPad 4 with iso 7.0.3 he is restarting himself ... How can i solve this problem please help me
Standard troubleshooting...
1. Try a Restart by pressing the sleep/lock button until you see the slider. Slide to power off. Restart by pressing the sleep/lock button until you see the Apple logo.
2. Try a Reset by pressing the home and sleep buttons until you see the Apple logo. Takes about 5-15 secs of button holding and you won't lose any data or settings.
3. Remove apps from Recently Used list...
- From any Home Screen, double tap the home button to bring up the Recents List
- Swipe up on the app preview card to remove it from the list
- Press the home button when done.
4. If still a problem restore with your backup.
5. If still a problem restore as new, i.e. without your backup. See how it runs with nothing synced to it.
6. If still a problem, it's likely a hardware issue. -
my apple id is not working when i sign in from my laptop it works but when i sign in from my iphone4 then its not working it gives the message of "your aapleid or password is incorrect"? how can i solve this problem please help
Hey nocillado,
Thanks for using Apple Support Communities.
It sounds like you have 2 things you want to address. These articles can help you use iCloud with your existing Apple ID.
Get help activating your iPhone
http://support.apple.com/kb/ts3424
Using your Apple ID for Apple services
http://support.apple.com/kb/ht4895
Using the same Apple ID for Store purchases and iCloud (recommended)
Have a nice day,
Mario -
My Ipod is disable, How can I fix the problem please help
My I-pod is disable, how can I fix the problem, Please Help
If it is disabled because of the passcode, see this article: iPhone and iPod touch: Wrong passcode results in red disabled screen
If you cannot remember the passcode, you will need to restore your device using the computer with which you last synced it. This allows you to reset your passcode and resync the data from the device (or restore from a backup). If you restore on a different computer that was never synced with the device, you will be able to unlock the device for use and remove the passcode, but your data will not be present. Refer to Updating and restoring iPhone and iPod touch software.
If the issue continues after updating and restoring your device, refer to this document. -
Invalid hotmail email account, can't solve the problem please help
Hi,
I got an email from my network required update password. I've entered her email address and password repeatedly and received the following message:
Invalid email address or password. Please verify your email address and password. The information you provided is incorrect. If the error persists contact hotmail.com (your email provider). Please try again.
Now I tried this more than 10 times from the blackberry email wizard and from my computer and still received the same messages. Also tried to change new password and set up again However still the same. I have 3 hotmail accounts, another 2 work well except my main email. (all of them are my personal email)
Anyone can help?? Have no idea what wrong with my bb or hotmail. I went to Optus today, one of a staff said Sorry i can't help u as i have no idea about blackberry!!!! please help me.
tried to delete and set up, take battary out ect... still can't set up it.All, please try it again now.
By the way, my guy feeling is this is/was a MSN/Hotmail/Livemail server issue, as only those accounts were affected. Others such as Yahoo, gmail, etc., were not.
1. If any post helps you please click the below the post(s) that helped you.
2. Please resolve your thread by marking the post "Solution?" which solved it for you!
3. Install free BlackBerry Protect today for backups of contacts and data.
4. Guide to Unlocking your BlackBerry & Unlock Codes
Join our BBM Channels (Beta)
BlackBerry Support Forums Channel
PIN: C0001B7B4 Display/Scan Bar Code
Knowledge Base Updates
PIN: C0005A9AA Display/Scan Bar Code -
Hello today I wanted to download an app on my ipod touch infact its a game and as usual it asked for my appl id and password so I entered them but next it asked me to enter my passowrd againg and answer the secret question I submited when I first got my Ipod touch, the problem is i cant remember the question neither the answer,so is there a way I can find out what my secret question is and the answer of course I would appreciate youre help.
FouadOnly you and Apple know your secret question. See if changing the password via email will allow access to your account.. Then you can chnag yur secret question. See:
http://support.apple.com/kb/HE36 -
I have just updated my Iphone and Ipad to the newest IOS that Apple has available. And now none of my Imessages work or facetime. How can i fix this?
Try giving your iPad a reset. Hold down the sleep and home keys for about 20 seconds. When you see the silver apple, let go and let it reboot and try again.
How are you charging it? its's best charged plugged into the wall not via USB. So if you're trying via USB, try using the supplied power block plugged into the wall. -
"Directory Listing Denied
This Virtual Directory does not allow contents to be listed."URL of that website?
-
Hi,
A few songs from my old purchase is not available for download. It shows as purchased but I can't download it. Please help me resolve this problem, what do I need to do to enable download for all my purchased songs/movies etc.
- AvinashThe purchases are probably hidden:
http://support.apple.com/kb/ht4919 -
hello i am trying to update my phone . i am connecting it to itunes but it is giving error 3194 . can you help me resolve this problem please.
Hi ali hakim,
Welcome to the Support Communities!
The article below may be able to help you with this issue.
Click on the link to see more details and screenshots.
iOS: Restore error 3194 or 'This device isn't eligible for the requested build'
http://support.apple.com/kb/TS4451
This occurs when iTunes is unable to communicate with the update-and-restore server (gs.apple.com). This is most likely because it is being blocked, redirected, or interrupted by security software, hosts-file entries, or other third-party software.
Cheers,
- Judy -
I have already downloaded the ios 7 but cannot access the iTunes Radio from the music app. There is no iTunes Radio icon at all! How did that happen? How can I resolve the problem? Please help. Thanks!
It didn't show up in my music app for several hours. Don't know why... But it's there.
I can now access and add stations through the iTunes Store to play through music app icon. -
Hello... Please help me... how can i resolve this problem... please help... when i update this device then this is problem is shown and after update ios I could not use iphone for a single days...
See "What does iTunes back up?" here:
http://support.apple.com/kb/HT4946
That is what you will get back. You will lose other things (example, mail messages). -
I want to buy an in-app purchase but i don`t remember my security questions and i cant access my recovery email either, what can i do? i have 100$ on my account and cant use it because of that problem, please help URGENT
If you have a rescue email address on your account then you can use that - follow steps 1 to 5 half-way down this page will give you a reset link on your account : http://support.apple.com/kb/HT5312
If you don't have a rescue email address (you won't be able to add one until you can answer your questions) then you will need to contact Support in your country to get the questions reset : http://support.apple.com/kb/HT5699 -
Few days before I brought one iphone 5 by second party and this phone make a unlock but it sometime have a cellular network most of time say no service can u solve this problem please and I put serial number it say this phone is replace can u help me for original serial number....
If Apple's service database says that your iPhone was replaced, then Apple will no longer provide any service for that phone.
First, get a new SIM from your cell carrier and see if that corrects the problem. If it does not, try the usual steps for addressing software problems: restart, reset, restore.
http://support.apple.com/kb/HT1430
http://support.apple.com/kb/HT1414
If you try restoring from a backup and that doesn't fix the problem, try restoring to factory settings and, if the problem goes away, then sync back your apps and content. You'll lose the app data and settings, but if the problem is due to a corrupt cache or settings file, restoring to factory settings should cure it.
If none of that helps, your device may have developed a hardware fault. Again, Apple will provide no service for it, so you will need to pay some independent repair shop to fix your iPhone.
Regards.
Maybe you are looking for
-
Dear Apple support, how can i delete my itunes account as i think im being hacked!! over the past few months a lot of money seems to be taken from my account ranging from as little as £1 to £60... i cant take any more. Can i delete the account? Can u
-
when i checked an ods i had created ,it showed a message:ods XXX is not consistent,i want to know what is it mean of this not consistent ?does it compare with something?if yes,what does it compare with and how can i correct this mistake?
-
Alerts for certificate expiry?
Hello everyone, I have a quick question: is there any way to get alerts for certificate expiry before a threshold number of days? If so, can the alert be for certificates that are required for the PI environment, SAP Portal or infrastructure ones tha
-
ThinkPad USB Keyboard Driver SK-8855
The ThinkPad USB Keyboard SK-8855 is not listed in the driver matrix. I can only find the one for the newer 55Y9003. Help? Does anybody know if the newer driver works with the older keyboard?
-
New Ipod freezing itunes.
I just got an ipod 80gb classic. I already have a 5th generation 30gb on file in itunes. I'm trying to sync my new 80gig and itunes freezes up. As soon as i disconnect the ipod everything unfreezes. It's downloaded like 9 songs then stops. I also got