[Beepcore-java-commits] CVS: beepcore-java/src/org/beepcore/beep/core InputDataStream.java,1.2,1.3
Status: Beta
Brought to you by:
huston
From: Huston F. <hu...@us...> - 2002-01-15 16:03:02
|
Update of /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/core In directory usw-pr-cvs1:/tmp/cvs-serv6703/src/org/beepcore/beep/core Modified Files: InputDataStream.java Log Message: Fixed bug with setComplete being called after waitForNextSegment Index: InputDataStream.java =================================================================== RCS file: /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/core/InputDataStream.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** InputDataStream.java 2001/11/08 05:51:34 1.2 --- InputDataStream.java 2002/01/15 16:02:59 1.3 *************** *** 161,167 **** } public BufferSegment waitForNextSegment() throws InterruptedException { synchronized (buffers) { ! if (availableSegment() == false) { buffers.wait(); } --- 161,174 ---- } + /** + * + * @returns null if isComplete() is true. + */ public BufferSegment waitForNextSegment() throws InterruptedException { synchronized (buffers) { ! while (availableSegment() == false) { ! if (isComplete() == true) { ! return null; ! } buffers.wait(); } *************** *** 185,189 **** void setComplete() { this.complete = true; ! // @todo notify objects waiting for more buffers. } --- 192,198 ---- void setComplete() { this.complete = true; ! synchronized (this.buffers) { ! this.buffers.notify(); ! } } *************** *** 195,258 **** private InputDataStreamAdapter stream = null; } - /** - * Returns the content type of a <code>InputDataStrea</code>. If - * the <code>BufferSegment</code> containing the content type - * hasn't been received yet, the method blocks until it is - * received. - * - * @return Content type. - * - * @throws BEEPException - * @deprecated - */ - // public String getContentType() throws BEEPException - // { - // return this.getInputStream().getContentType(); - // } - - /** - * Returns the value of the MIME entity header which corresponds - * to the given <code>name</code>. If the <code>BufferSegment</code> - * containing the content type hasn't been received yet, the - * method blocks until it is received. - * - * @param name Name of the entity header. - * @return String Value of the entity header. - * - * @throws BEEPException - * @deprecated - */ - // public String getHeaderValue(String name) throws BEEPException - // { - // return this.getInputStream().getHeaderValue(name); - // } - - /** - * Returns an <code>Enumeration</code> of all the MIME entity - * header names belonging to this <code>InputDataStream</code>. - * If the <code>BufferSegment</code> containing the content type - * hasn't been received yet, the method blocks until it is - * received. - * - * @throws BEEPException - * @deprecated - */ - // public Enumeration getHeaderNames() throws BEEPException - // { - // return this.getInputStream().getHeaderNames(); - // } - - /** - * Returns the transfer encoding of a <code>InputDataStrea</code>. - * If the <code>BufferSegment</code> containing the content type - * hasn't been received yet, the method blocks until it is - * received. - * - * @throws BEEPException - * @deprecated - */ - // public String getTransferEncoding() throws BEEPException - // { - // return this.getInputStream().getTransferEncoding(); - // } - --- 204,205 ---- |