int totalRead = 0;
if (master instanceof PullSourceStream)
totalRead = ((PullSourceStream)master).read(buffer, offset, length);
if (master instanceof PushSourceStream)
totalRead = ((PushSourceStream)master).read(buffer, offset, length);
for (Enumeration e = slaves.elements(); e.hasMoreElements();) {
Object stream = e.nextElement();
byte[] copyBuffer = new byte[totalRead];
System.arraycopy(buffer, offset, copyBuffer, 0, totalRead);
((PushSourceStreamSlave)stream).setBuffer(copyBuffer);
}
return totalRead;