Bytes/chars stream problems

hi to all...
this is my first message in this good forum...
I've this question: is it possible to create on a single socket 2 streams?exactly:
BufferedReader in = new BufferedReader(new InputStreamReader(sClient.getInputStream()));
and
BufferedInputStream bufferedInputStream = new BufferedInputStream(sClient.getInputStream());
The first for strings (commands) , the other for byte streams (file transfer).
The error is that if a I try to print the line of the first buffer, incomprensibles chars are printed on my shell, probably because the line printed is not teh string requested but the byte stream.....so....2 getInputStream is not possibl on a single socket???
To solve???only another socket??
please help me..
Thank you
euronymous

the point is that during a file transfer, the server
must be able to send messages to clients...Almost: the point is that both the server and the client have to agree on
the protocol to be used by both parties. Suppose a server wants to send
a file to a client. The server could send the name of the file (a String)
followed by a number (the block length) and a block of data with that
length. This block length/data tuple could be sent more than once.
If the block length becomes equal to zero it means: nothing to send
anymore, the client has the entire file content.
The block length could be an int while the block itself could be a sequence
of bytes; both very convenient information for the client to have ...
A bit more complicated scenario: the client could send a confirmation
back to the server after every block; or a negative confirmation telling
the server to stop sending ...
But first of all you have to get your protocol defined.
thank joisYou're welcome,
kind regards,
Jos

Similar Messages

  • ICloud photo stream problem

    Hi all - I really need your help. 
    My iPhoto '11 was working just fine until I upgraded it to 9.4.3.  I also just installed the recent system upgrade.  Now I am having multiple problems. It seems to stem from Photo Stream.  Activity Monitor shows that Photo Stream is using up gobs of CPU which is strange since it is supposed to not be working...
    In iPhoto, under the preferences, it shows that Photo Stream is not enabled.  If I check the box to turn it on, it just unchecks itself just as quickly.  But in the system preferences, it shows that Photo Stream is set up just fine.  Photo Stream is certainly not working.  And it seem to be totally screwing up iPhoto.  I have tried multiple iPhoto fix options (option alt fixes, restoring a backup library, uninstalling then reinstalling iPhoto) with no improvement.
    I'm not sure if the problem is coming from iPhoto or iCloud Photo Stream problems.  I am running OSX 10.8.4 on a 3.4 GHz Intel Core i7.
    Can anyone tell me what to do?  Thank you so much!

    Well Old Toad, I am stumped.
    I double checked and logged out of iCloud in both user accounts and made sure that PS was not enabled on either library.  Then I restarted the computer.  I went back to my main user account (second account set up = non administrator account) and to my main iPhoto library, logged into iCloud, tried turing on PS = did not work.
    If I do the exact same thing as above for a restore of a backup of my library = does not work.
    If I do the exact same thing above but log in with my first account (not my main one but it is the admin account on the computer) and access the test library I created = PS works just fine with no problem.
    It seems the problem with PS is limited to my primanry account (non-admin).  Do you think the admin privaledges difference between the two accounts could be the problem...?
    As always, I am thankful for your time and advice.

  • Nokia c2-03 online video streaming problem ...:(

    Hello.
    I have purchased new nokia c2-03, and i thought the phone would b awesome as its a nokia product. But this phone disappointed me a lot. The phone has good features being a low cost phone. But the main problem is it can't stream online videos. Its very strange to belive, i never thought that NOKIA could b so careless please nokia solve this streaming problem in next firmware update..
    Lookin forward for a reply.
    -GURU

    ENG
    I Am Sorry. In fact had the DST setting to + 1:0 and I changed to 12:0 am; As the clock time was delayed, because in Portugal we are indeed in summer time!, I changed the time directly. Unfortunately the reminders remain with an hour of advance. The alarm clock that is set crescento for 7:15 minutes as the set initially and never changed. The first reminder has been set for the 7:15 but is now changed to 6:15 due to this error. Does anyone have any suggestions other than modify all reminders. I would add that the Firmware of the Nokia C2 03 est actualized to a V7.48.
    PT
    Lamento. De facto tinha a definição de hora de verão para +1hora e alterei para 0horas;
    Como a hora do relógio ficou atrasada, pois em Portugal estamos de facto na hora de verão!, alterei directamente a hora.
    Lamentavelmente os lembretes continuam com uma hora de avanço.
    A crescento que o despertador está definido para as 7:15 minutos como o defini inicialmente e nunca sofreu alterações. O primeiro lembrete foi definido para as 7:15 mas está alterado para as 6:15 devido a este erro.
    Será que alguém tem alguma sugestão que não seja modificar todos os lembretes.
    Acrescento que o Firmware do Nokia C2 03 está actualizado para a V7.48.

  • New Radio Station & Streaming Problems

    I have added my favorite Public Radio station to my iTunes library, but I can not get it to connect. It shows up in the library as a radio station, but nothing happens when I click on the play button.
    In addition, I'm having trouble with all the radio stations I've tried that were already in the iTunes folder. I've tried changing the streaming buffer size in preferences, but the network keeps stalling and needing rebuffering, regardless of the streaming buffer size I choose.
    PowerBook PowerPC G4   Mac OS X (10.4.2)   Other computer is iMac, OS X v.10.3.9

    I single file in a playlist repeats constantly for me (just tried it - don't usually have playlists for single items), but I have never tried using repeat on an audio stream. I expect the repeat doesn't work with streams because iTunes never gets an end-of-file notification which would then tell iTunes to start again at the beginning - but that is just a guess.
    What happens if you open the stream in Quicktime? If the stream is in iTunes library, you can open it's Get Info box, click on Edit URL on the summary tab, and you can then copy the address to paste into Quicktime's Open URL. If the stream is one on the default iTunes Radio list, drag it into your Library and you can then click on the Edit URL button to copy the address. iTunes an Quicktime are not exactly the same, so you may get different results. You could also try VLC Player". Testing streams in another player may help you identify if it is really iTunes at fault.
    I usually don't have streaming problems, although I rarely have a stream on longer than 2 or 3 hours at a time and I think about 5 hours is the longest I've had a stream running.

  • Double byte chars in URI

    Is it possible to send double byte chars through a URI? Is this possible to send from a servlet to a client browser then the client browser will just forward it on back to a server. What would have to happen on the server and client side for this to happen?
    I guess I have basic non-understanding on how encoding works through http, using a client browser and also sending a response to a servlet container. Can anyone tell me how this process works? What are the default encodings, what is configurable on the client side or server side, etc.? Thanks.

    I believe the rule is that you first have to encode the string into UTF-8 bytes, then apply the URL-encoding rules to that array of bytes. At least, that's how I understand the most recent rules for HTTP. But it's likely that most browsers don't follow this rule properly, so be prepared for a rough ride if you try this.

  • Netflix Streaming Problem with new AppleTV 1080

    Hi there,
    I have had a AppleTV 2 720 for two years. It has been working perfectly with Netflix. I have a new AppleTV 1080 and the streaming from Netflix is awful. The picture drops definition and the audio goes out of sync and sometimes it just comes up with an error message. I have BT Infinity (30+mbps) and never have any issues streaming from Netflix via two or three devices at any one time. I have searched forums with no solution. I have tried lowering from 1080 to 720 on AppleTV, (kind of negates the purchase of a 1080 device though, eh), restarted and restored the AppleTV, logged out and into Netflix. The super HD picture when working is great but not sure if AppleTV 1080 is suited to Netflix. Surely I can't be the only sufferer here, please help! Thank you....

    I found this hidden away on the forum:
    This is what worked for me. It was posted by BenFinklea so he deserves the credit. Since I've done these steps I've had no streaming issues. I agree that it's an Apple issue and not a Netfix one. All my other devices on and off the same network stream just fine. To test this I even bought a Roku LT which I love, especially for the money and it streamed flawlessly. I perfer the format of my Apple TV so I was glad to have it operational again! Good luck.
    Use Google’s Public DNS Server To Fix Apple TV Streaming Problems
    1. Navigate to Settings >> General >> Network and select Configure TCP/IP.
    2. Select “Manually” next to Configure IP.
    3. Dont change the IP address or the Subnet Mask and Router Address. Just click "Done".
    4. Set the DNS Address screen with the following: 008.008.008.008 and click “Done.”
    You should now be able to stream Netflix on your Apple TV.
    I moved the Apple TV unit away from other electronics and rebooted the router/BT Hub and restarted Apple TV. I did the fix as above and it seems to be ok. Will update soon! Thanks Winston....

  • FM to convert double byte chars

    Hi All,
    Is there anyone know what are the function module to convert double-byte chars? Thanks.

    Seems like Blue Sky is not clear
    You want to convert what into what?
    Whats the purpose of this requirement, kindly give more details.
    Regards
    Karthik D

  • HDV "Stream Problem" while digitizing.

    I am trying to digitize some HDV footage shot in 720p30. I get deck control I can play the footage in the capture window but when I try to capture now it will capture only a few seconds and then stop and give me this message.
    "Stream Problem"
    "Capture was stopped due to a problem with the incoming stream. This might be a problem with the tape. All media up to this point has been preserved."
    Does anyone know what is going on here or how to fix it?

    Greetings everyone,
    Just want to add my two cents and testify that this is a real problem regardless of what JVC or Apple want to disavow. My comrade and I shoot with two JVC GY-HD100U's with the HDV 720p30 codec. We purchased the Firestore DR-HD100's (God bless their soul - I don't care what all the reviewers say about this product - they need a visit from the iPod development team) with the cameras and use those for majority of jobs. No problems with TC breaks. However take that backup tape that was simultaneously recording with the Firestore and perform long captures from tape, we encounter stream breaks. Both cameras have had this problem out of the box. We don't have a dedicated deck since we figured most work will come off the Firestores so when we capture from tape its from the camera. However the Firestores are limited by battery life and for long continuous shoots we fall back on tape. Hence the frustration of TC breaks. Could someone from JVC or Apple take some initiative and find the flaw? Thanks.
    iMac 20-inch 2 GHz Intel Core Duo   Mac OS X (10.4.5)   1GB System RAM/256MB Video RAM

  • Use Google's Public DNS Server To Fix Apple TV Streaming Problems

    Many people have been having a streaming problem with the Apple TV - especially with Netflix. In fact, it's often the most popular topic on this forum. After having the same problem off and on for two years, I finally figured out the following solution. It uses Google's public DNS service instead of your ISPs DNS.
    1. Navigate to Settings >> General >> Network and select Configure TCP/IP.
    2. Select “Manually” next to Configure IP.
    3. Dont change the IP address or the Subnet Mask and Router Address. Just click "Done".
    4. Set the DNS Address screen with the following: 008.008.008.008 and click “Done.”
    You should now be able to stream more smoothly on your Apple TV.
    This problem is probably caused by a bad streaming server somewhere on Netflix's CDN (Content Delivery Network). The DNS points your Apple TV based on location. By using Google's DNS, you get a different streaming server. That is, of course, a wild guess and is not verifiable by me. But, it makes sense so I'm going with that.
    If this works for you, please buy a cup of coffee for a complete stranger or some other selfless, random act of kindness.

    Welcome to the  tv Discussion Forums.
    Barring interference to the network (which is probably unlikely but not totally out of the question) I'd agree that your problem seems specific to one mac. IMHO reinstalling an OS is more often than not a lazy mans way of saying they can't be bothered to look for the problem and totally unnecessary so far as I am concerned. I don't believe any version of itunes has been a problem for the tv, although there have been the usual problems posted that usually accompany any upgrade (these are more than likely due to updating over damaged files).
    Reinstalling itunes will replace the application but not many of the associated preference files that are more likely to be a problem than the application itself. Rather than reinstalling itunes, I'd try creating a new user and try itunes in the new user account to see if the problem persists.
    You could also create a new library in the original user account and see if you have similar problems with that library.
    Check your network settings and compare them to the other macs that work OK, check for proxy servers and DNS addresses.

  • Apple TV streaming problems with itunes

    Apple TV streaming problems. Since recent last update to AppleTV when I try to streams movie or tv show from iTunes sometimes it is fine sometimes it takes hours (Hd or Sd). No problem with netflix. Wifi is not super strong in location but this was not a problem at all before update. Any suggestions?
    Paul

    ok.
    this is not a solution to your problem, but you didn't need to do that just to remove it from appletv. you could have simply unticked the item in your library and that would have made it not available to appletv. you could also have amended your sync options. you don't need to delete something from your library just to remove it from appletv.
    however back to your problem. it sounds like the appletv is not syncing the changes to your library. you should restart your appletv and see if that forces the change.

  • Convert/Represent 1 byte char in 2 bytes

    Hello All,
    I would like to convert/represent the 1 byte char to 2 byte.
    for example the "Test ��" is a 9 byte string if i use getBytes()
    the byte array length is 7 bytes but if i use getBytes("UTF8")
    i'm getting 9 bytes but it's not printing "��"
    Now i want to represent them in a 2 byte. How do i do that?
    Regards
    G S Sundaram

    getBytes("UTF16-BE") or getBytes("UTF16-LE"). What is �� supposed to be here?

  • Why is my iPhone having streaming problems?

    My iPhone 4S is having streaming problems. Every time I stream music or a video it keeps cutting out. It's done loading, but either the sound or the video just stops every few seconds and I have to keep pressing the play button. It's very frustrating, I've reset my iPhone but it didn't work. I downloaded the Chrome browser and it helped a little bit, but it still does it. And this has all happend after I downloaded the new update 6.1.2 Is there anyway to fix it??

    NO my iphone is not second hand
    i have done eveything from changing my sim card to a new one TO switching my phone offand on TO doing the airplan mode thing TO resetting the network settings!
    the only thing left to do is trash the stupid phone!

  • Transport Stream Problems

    My compressor keep locking up when I set it to export in "MPEG-2/Transport Stream" setting. I would like to export in this setting because I believe that this is how Toast encodes to BluRay.
    Any ideas/thoughts/solutions?
    Go Hornets!

    I'm not sure about your transport stream problem, but Toast doesn't need it; it will use its AVCHD encoder on a regular QT movie; I exported a self contained QT movie from an FCP timeline, dragged it into the Toast window, and let it encode; it worked well.
    If you send Toast a previously compressed file, it will encode it again in the AVCHD format, probably at a loss of quality.
    Toast can burn the Blu Ray format to a standard DVD, giving you about 30 minutes of HD footage, and using your standard DVD burner.

  • Difference between BYTE & CHAR

    hi all,
    In Oracle, As per below syntax, what is the difference between BYTE & CHAR used as datatype size for NAME column:
    CREATE TABLE CLIENT
    NAME VARCHAR2(11 BYTE),
    ID_CLIENT NUMBER
    and
    CREATE TABLE CLIENT
    NAME VARCHAR2(11 CHAR), -- or even VARCHAR2(11)
    ID_CLIENT NUMBER
    rgds,
    pc

    First of - do not use reserved words for columns (NAME).
    If the database character set is UTF-8, which I believe is the default in recent version of Oracle. In this case, some characters take more than 1 byte to store in the database.
    If you define the field as VARCHAR2(11 BYTE), Oracle will allocate 11 bytes for storage, but you may not actually be able to store 11 characters in the field, because some of them take more than one byte to store, e.g. non-English characters.
    By defining the field as VARCHAR2(11 CHAR) you tell Oracle to allocate enough space to store 11 characters, no matter how many bytes it takes to store each one. I believe that in Oracle 10g, 3 bytes per character were used.
    regards,
    Robert.

  • Byte[] -- char[]

    Hi,
    Without casting each member of the array, can we cast byte[] --> char[] ??
    thank you.

    Ok, common misconception. Just because you may be
    able to write
    char[] = byte[].toString();
    doesn't mean its any faster.But you can't write that :P Even if you call toCharArray() after you get the String, it's going to give you the hashcode, not a conversion.

Maybe you are looking for