if (bufferedImageBytes.length >= ByteArrayList.MESSAGE_LIMIT) {
imageBytes = bal.divideArrayList(ByteArrayList.MESSAGE_LIMIT, bufferedImageBytes);
int numberOfParts = imageBytes.size();
int imageCount = 0;
for (byte[] b : imageBytes) {
gameServer.getMyServer().broadcast(new WebcamMessage(b, numberOfParts, imageCount, imageID).setReliable(false));
++imageCount;
}
} else {
int numberOfParts = -1;
int imageCount = -1;
gameServer.getMyServer().broadcast(new WebcamMessage(bufferedImageBytes, numberOfParts, imageCount, imageID).setReliable(false));
}
} catch (IOException ex) {
Logger.getLogger(WebcamServer.class.getName()).log(Level.SEVERE, null, ex);
}