Code example for Condition

Methods: signalAll

0
        try { 
            if (!hasData()) { 
                waitForData(); 
            } 
            if (isEndOfStream()) { 
                return -1; 
            } 
            return this.buffer.get() & 0xff;
        } finally { 
            this.lock.unlock();
        } 
    } 
 
    public int read(final byte[] b, int off, int len) throws IOException {
        if (this.shutdown) {
            return -1; 
        } 
        if (b == null) {
            return 0; 
        } 
        this.lock.lock();