Ciao a tutti sono nuovo del forum... Avrei un problemino con un codice Visual C++ ... cioe devo trasformare questo codice in Java ma riscontro problemi...

codice:
int InviaInfo(Socket ^s, String ^str)
 {
 try 
{ str += L"\n\0";
 array<Byte> ^packet = Encoding::UTF8->GetBytes(str);
 if(s->Connected)
 s->Send(packet,str->Length,SocketFlags::None);
 } catch(SocketException ^e)
 { return e->ErrorCode; } return 0; }
perfavore potete aiutarmi voi? Riuscireste a trasformarlo in Java???
Grazie mille in anticipo...

PS: Il metodo su cui incontro maggiori difficolta nel "Tradurre" è soket->Send()