im new to java and i have a question regarding Synchronized.
i have the following code for writing to network (simple implementation for now):
public void networkSendData(byte[] data){
try {
out.write(data);
out.flush();
} catch (IOException e) {
}
}
i was wondering if there is a need for block level Synchronized here as im am writing the whole data at once. or is there a chance for race condition? i ask because the data to write is coming for multiple sources.
thank you.