void receive(int length,DataInputStream in) throws IOException {
synchronized (lock) {
    if ((pos > 0) && ((buffer.length - present) < length)) {
      System.arraycopy(buffer,pos,buffer,0,present - pos);
      present-=pos;
      pos=0;
    }
    if ((buffer.length - present) < length)     throw new IOException("Receive buffer overflow");
    in.readFully(buffer,present,length);
    present+=length;
    requested-=length;
    lock.notifyAll();
  }
}

void receive ( int length , DataInputStream in ) throws IOException { synchronized ( lock ) { if ( ( pos > 0 ) && ( ( buffer . length - present ) < length ) ) { System . arraycopy ( buffer , pos , buffer , 0 , present - pos ) ; present -= pos ; pos = 0 ; } if ( ( buffer . length - present ) < length ) throw new IOException ( "Receive buffer overflow" ) ; in . readFully ( buffer , present , length ) ; present += length ; requested -= length ; lock . notifyAll ( ) ; } }
receive bytes transmitted from connection at remote endpoint .
