public int read(byte[] b, int off, int len) {
		// 1.等待缓冲区有足够内容可读
		synchronized (lock) {
			while (bufsize < len && !eof) {
				try {
					waitForBuffering();
				} catch (InterruptedException e) {
					return -1;
				}
			}
			if (bufsize == 0)
				return -1;
			if (bufsize < len)
				len = bufsize;
		}

		// 2.从缓冲区读取
		int srcOff = offset & OFFMASK;
		int bytes = BUFLEN - srcOff;
		if (bytes < len) {
			System.arraycopy(buf, srcOff, b, off, bytes);
			System.arraycopy(buf, 0, b, off + bytes, len - bytes);
		} else
			System.arraycopy(buf, srcOff, b, off, len);
		synchronized (lock) {
			bufsize -= len;
		}
		offset += len;

		// 3.通知"写"线程
		synchronized (buf) {
			buf.notify();
		}

		return len;
	}