Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 7A6E9200B84 for ; Tue, 20 Sep 2016 17:01:08 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 78F3A160AC5; Tue, 20 Sep 2016 15:01:08 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 212E9160AC0 for ; Tue, 20 Sep 2016 17:01:06 +0200 (CEST) Received: (qmail 96863 invoked by uid 500); 20 Sep 2016 15:01:06 -0000 Mailing-List: contact dev-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Commons Developers List" Delivered-To: mailing list dev@commons.apache.org Received: (qmail 96825 invoked by uid 99); 20 Sep 2016 15:01:05 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 20 Sep 2016 15:01:05 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 2D5021A99D0 for ; Tue, 20 Sep 2016 15:01:05 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.179 X-Spam-Level: * X-Spam-Status: No, score=1.179 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd2-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id 6x0j56Tx3mVK for ; Tue, 20 Sep 2016 15:00:59 +0000 (UTC) Received: from mail-oi0-f50.google.com (mail-oi0-f50.google.com [209.85.218.50]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id 20F3B5FE34 for ; Tue, 20 Sep 2016 15:00:59 +0000 (UTC) Received: by mail-oi0-f50.google.com with SMTP id a62so24815625oib.1 for ; Tue, 20 Sep 2016 08:00:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=Yhy2KiZXDufWER4TLlYGDiFu2xaAimilF+2aaujfCdE=; b=aPhvK+noMwlkMu/sML7xC1z8KLtY2ugWDTHn2S4MUXJpA49xBQFpVvDmm/gkGK/HJM 3MNTaNq/1dKtAXhXeMQUZSf1eZyGuvsNhW9uB3ZD5J1yi3RuJcsA7r9KboyTxPQpzhWZ gZKHP9YV45lUjiih2bfjMekKrGL6wCkhNaiXsrNE+4QxgCZoEDzy+u06McdXC0YdYOEu 1pfbekVGa9owMESAA/L8sbBKbiEkydHQyzNlR/O3Rr9Mn/kiSIX0Mjud0CBS6Ejf9na1 w2xMUbtCY7IZ7mf4fuhd2HTQH+0lWiUgmJiXWVAgWeY1YKp2o0NQRuTB6m0eR1ffnxys NxDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=Yhy2KiZXDufWER4TLlYGDiFu2xaAimilF+2aaujfCdE=; b=J56JES+MmnRNT0zj+fciRwDKqDyVrv/DvqyB+mGgaAoMCa941itKSBB/f8zktltxJQ +S+ND3RxnJaFB4dWtDdxFRIHvsBSL74QNiUTE/pK2qHVMLgmKmuENm8Uu7qNnTmOAFSM dW4z/UY4eMzPh7bRwwaJyCHqFh5CskdCLg4c/xsivJFo2JL8mjMFTnTN3Ao/APIX/CVG la0nKiOQ35ZpidZzHtiiHswPKYkpqM7Rbv34XNGvZ8rqniQomt0MIgrGzF7wtDPCzUyo zIuP9+aaToEA4OPbl+wttjjI8uxfeqjruOAywxkWb5GyyPJXzcMXN5S/QPUoZZNVwGcA LcvA== X-Gm-Message-State: AE9vXwOd9VCCuS2X7cOYfUSZAGSrhRtLyeWnz6P+L6wv3Lu8R8iWPHGhy2WkAQNzAVsscxfoSWWtRYhl1SxvFw== X-Received: by 10.202.108.23 with SMTP id h23mr40938037oic.9.1474383657775; Tue, 20 Sep 2016 08:00:57 -0700 (PDT) MIME-Version: 1.0 Received: by 10.157.60.251 with HTTP; Tue, 20 Sep 2016 08:00:57 -0700 (PDT) Received: by 10.157.60.251 with HTTP; Tue, 20 Sep 2016 08:00:57 -0700 (PDT) In-Reply-To: References: <93a67a03c27147d68f5e6a8cfd733570@git.apache.org> From: Gary Gregory Date: Tue, 20 Sep 2016 08:00:57 -0700 Message-ID: Subject: Re: commons-io git commit: Remove redundant type arguments. To: Commons Developers List Content-Type: multipart/alternative; boundary=001a1142e82a2f38c8053cf1b2ca archived-at: Tue, 20 Sep 2016 15:01:08 -0000 --001a1142e82a2f38c8053cf1b2ca Content-Type: text/plain; charset=UTF-8 This annoying :-( it must be an EOL thing. Gary On Sep 20, 2016 7:18 AM, "Matt Sicker" wrote: > Did the line ending change? > > On 20 September 2016 at 01:59, Benedikt Ritter wrote: > > > Hello Gary, > > > > why has the whole file changed? > > > > Regards, > > Benedikt > > > > schrieb am Di., 20. Sep. 2016 um 07:40 Uhr: > > > > > Repository: commons-io > > > Updated Branches: > > > refs/heads/master 9ba9b49af -> 822bd135f > > > > > > > > > Remove redundant type arguments. > > > > > > Project: http://git-wip-us.apache.org/repos/asf/commons-io/repo > > > Commit: http://git-wip-us.apache.org/repos/asf/commons-io/commit/ > > 822bd135 > > > Tree: http://git-wip-us.apache.org/repos/asf/commons-io/tree/822bd135 > > > Diff: http://git-wip-us.apache.org/repos/asf/commons-io/diff/822bd135 > > > > > > Branch: refs/heads/master > > > Commit: 822bd135f3a54b8fbeb23c313535b13c18198c3a > > > Parents: 9ba9b49 > > > Author: Gary Gregory > > > Authored: Mon Sep 19 22:40:29 2016 -0700 > > > Committer: Gary Gregory > > > Committed: Mon Sep 19 22:40:29 2016 -0700 > > > > > > ---------------------------------------------------------------------- > > > .../commons/io/input/ObservableInputStream.java | 476 > > +++++++++---------- > > > 1 file changed, 238 insertions(+), 238 deletions(-) > > > ---------------------------------------------------------------------- > > > > > > > > > > > > http://git-wip-us.apache.org/repos/asf/commons-io/blob/ > > 822bd135/src/main/java/org/apache/commons/io/input/ > > ObservableInputStream.java > > > ---------------------------------------------------------------------- > > > diff --git > > > a/src/main/java/org/apache/commons/io/input/ObservableInputStream.java > > > b/src/main/java/org/apache/commons/io/input/ObservableInputStream.java > > > index 7d13472..c580ba4 100644 > > > --- a/src/main/java/org/apache/commons/io/input/ > > ObservableInputStream.java > > > +++ b/src/main/java/org/apache/commons/io/input/ > > ObservableInputStream.java > > > @@ -1,238 +1,238 @@ > > > -/* > > > - * Licensed to the Apache Software Foundation (ASF) under one or more > > > - * contributor license agreements. See the NOTICE file distributed > with > > > - * this work for additional information regarding copyright ownership. > > > - * The ASF licenses this file to You under the Apache License, Version > > 2.0 > > > - * (the "License"); you may not use this file except in compliance > with > > > - * the License. You may obtain a copy of the License at > > > - * > > > - * http://www.apache.org/licenses/LICENSE-2.0 > > > - * > > > - * Unless required by applicable law or agreed to in writing, software > > > - * distributed under the License is distributed on an "AS IS" BASIS, > > > - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or > > > implied. > > > - * See the License for the specific language governing permissions and > > > - * limitations under the License. > > > - */ > > > -package org.apache.commons.io.input; > > > - > > > -import java.io.IOException; > > > -import java.io.InputStream; > > > -import java.security.MessageDigest; > > > -import java.util.ArrayList; > > > -import java.util.List; > > > - > > > - > > > -/** > > > - * The {@link ObservableInputStream} allows, that an InputStream may > be > > > consumed > > > - * by other receivers, apart from the thread, which is reading it. > > > - * The other consumers are implemented as instances of {@link > > Observer}. A > > > - * typical application may be the generation of a {@link > MessageDigest} > > > on the > > > - * fly. > > > - * {@code Note}: The {@link ObservableInputStream} is not > > thread > > > safe, > > > - * as instances of InputStream usually aren't. > > > - * If you must access the stream from multiple threads, then > > > synchronization, locking, > > > - * or a similar means must be used. > > > - * @see MessageDigestCalculatingInputStream > > > - */ > > > -public class ObservableInputStream extends ProxyInputStream { > > > - public static abstract class Observer { > > > - /** Called to indicate, that {@link InputStream#read()} has > been > > > invoked > > > - * on the {@link ObservableInputStream}, and will return a > > value. > > > - * @param pByte The value, which is being returned. This will > > > never be -1 (EOF), > > > - * because, in that case, {link #finished()} will be > invoked > > > instead. > > > - */ > > > - void data(int pByte) throws IOException {} > > > - /** Called to indicate, that {@link InputStream#read(byte[])}, > > or > > > - * {@link InputStream#read(byte[], int, int)} have been > called, > > > and are about to > > > - * invoke data. > > > - * @param pBuffer The byte array, which has been passed to the > > > read call, and where > > > - * data has been stored. > > > - * @param pOffset The offset within the byte array, where data > > > has been stored. > > > - * @param pLength The number of bytes, which have been stored > in > > > the byte array. > > > - */ > > > - void data(byte[] pBuffer, int pOffset, int pLength) throws > > > IOException {} > > > - /** Called to indicate, that EOF has been seen on the > underlying > > > stream. > > > - * This method may be called multiple times, if the reader > keeps > > > invoking > > > - * either of the read methods, and they will consequently keep > > > returning > > > - * EOF. > > > - */ > > > - void finished() throws IOException {} > > > - /** Called to indicate, that the {@link ObservableInputStream} > > > has been closed. > > > - */ > > > - void closed() throws IOException {} > > > - /** > > > - * Called to indicate, that an error occurred on the > underlying > > > stream. > > > - */ > > > - void error(IOException pException) throws IOException { throw > > > pException; } > > > - } > > > - > > > - private final List observers = new > ArrayList(); > > > - > > > - public ObservableInputStream(InputStream pProxy) { > > > - super(pProxy); > > > - } > > > - > > > - public void add(Observer pObserver) { > > > - observers.add(pObserver); > > > - } > > > - > > > - public void remove(Observer pObserver) { > > > - observers.remove(pObserver); > > > - } > > > - > > > - public void removeAllObservers() { > > > - observers.clear(); > > > - } > > > - > > > - @Override > > > - public int read() throws IOException { > > > - int result = 0; > > > - IOException ioe = null; > > > - try { > > > - result = super.read(); > > > - } catch (IOException pException) { > > > - ioe = pException; > > > - } > > > - if (ioe != null) { > > > - noteError(ioe); > > > - } else if (result == -1) { > > > - noteFinished(); > > > - } else { > > > - noteDataByte(result); > > > - } > > > - return result; > > > - } > > > - > > > - @Override > > > - public int read(byte[] pBuffer) throws IOException { > > > - int result = 0; > > > - IOException ioe = null; > > > - try { > > > - result = super.read(pBuffer); > > > - } catch (IOException pException) { > > > - ioe = pException; > > > - } > > > - if (ioe != null) { > > > - noteError(ioe); > > > - } else if (result == -1) { > > > - noteFinished(); > > > - } else if (result > 0) { > > > - noteDataBytes(pBuffer, 0, result); > > > - } > > > - return result; > > > - } > > > - > > > - @Override > > > - public int read(byte[] pBuffer, int pOffset, int pLength) throws > > > IOException { > > > - int result = 0; > > > - IOException ioe = null; > > > - try { > > > - result = super.read(pBuffer, pOffset, pLength); > > > - } catch (IOException pException) { > > > - ioe = pException; > > > - } > > > - if (ioe != null) { > > > - noteError(ioe); > > > - } else if (result == -1) { > > > - noteFinished(); > > > - } else if (result > 0) { > > > - noteDataBytes(pBuffer, pOffset, result); > > > - } > > > - return result; > > > - } > > > - > > > - /** Notifies the observers by invoking {@link > > > Observer#data(byte[],int,int)} > > > - * with the given arguments. > > > - * @param pBuffer Passed to the observers. > > > - * @param pOffset Passed to the observers. > > > - * @param pLength Passed to the observers. > > > - * @throws IOException Some observer has thrown an exception, > which > > > is being > > > - * passed down. > > > - */ > > > - protected void noteDataBytes(byte[] pBuffer, int pOffset, int > > > pLength) throws IOException { > > > - for (Observer observer : getObservers()) { > > > - observer.data(pBuffer, pOffset, pLength); > > > - } > > > - } > > > - > > > - /** Notifies the observers by invoking {@link > Observer#finished()}. > > > - * @throws IOException Some observer has thrown an exception, > which > > > is being > > > - * passed down. > > > - */ > > > - protected void noteFinished() throws IOException { > > > - for (Observer observer : getObservers()) { > > > - observer.finished(); > > > - } > > > - } > > > - > > > - /** Notifies the observers by invoking {@link Observer#data(int)} > > > - * with the given arguments. > > > - * @param pDataByte Passed to the observers. > > > - * @throws IOException Some observer has thrown an exception, > which > > > is being > > > - * passed down. > > > - */ > > > - protected void noteDataByte(int pDataByte) throws IOException { > > > - for (Observer observer : getObservers()) { > > > - observer.data(pDataByte); > > > - } > > > - } > > > - > > > - /** Notifies the observers by invoking {@link > > > Observer#error(IOException)} > > > - * with the given argument. > > > - * @param pException Passed to the observers. > > > - * @throws IOException Some observer has thrown an exception, > which > > > is being > > > - * passed down. This may be the same exception, which has been > > > passed as an > > > - * argument. > > > - */ > > > - protected void noteError(IOException pException) throws > IOException > > { > > > - for (Observer observer : getObservers()) { > > > - observer.error(pException); > > > - } > > > - } > > > - > > > - /** Notifies the observers by invoking {@link > Observer#finished()}. > > > - * @throws IOException Some observer has thrown an exception, > which > > > is being > > > - * passed down. > > > - */ > > > - protected void noteClosed() throws IOException { > > > - for (Observer observer : getObservers()) { > > > - observer.closed(); > > > - } > > > - } > > > - > > > - protected List getObservers() { > > > - return observers; > > > - } > > > - > > > - @Override > > > - public void close() throws IOException { > > > - IOException ioe = null; > > > - try { > > > - super.close(); > > > - } catch (IOException e) { > > > - ioe = e; > > > - } > > > - if (ioe == null) { > > > - noteClosed(); > > > - } else { > > > - noteError(ioe); > > > - } > > > - } > > > - > > > - /** Reads all data from the underlying {@link InputStream}, while > > > notifying the > > > - * observers. > > > - * @throws IOException The underlying {@link InputStream}, or > either > > > of the > > > - * observers has thrown an exception. > > > - */ > > > - public void consume() throws IOException { > > > - final byte[] buffer = new byte[8192]; > > > - for (;;) { > > > - final int res = read(buffer); > > > - if (res == -1) { > > > - return; > > > - } > > > - } > > > - } > > > - > > > -} > > > +/* > > > + * Licensed to the Apache Software Foundation (ASF) under one or more > > > + * contributor license agreements. See the NOTICE file distributed > with > > > + * this work for additional information regarding copyright ownership. > > > + * The ASF licenses this file to You under the Apache License, Version > > 2.0 > > > + * (the "License"); you may not use this file except in compliance > with > > > + * the License. You may obtain a copy of the License at > > > + * > > > + * http://www.apache.org/licenses/LICENSE-2.0 > > > + * > > > + * Unless required by applicable law or agreed to in writing, software > > > + * distributed under the License is distributed on an "AS IS" BASIS, > > > + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or > > > implied. > > > + * See the License for the specific language governing permissions and > > > + * limitations under the License. > > > + */ > > > +package org.apache.commons.io.input; > > > + > > > +import java.io.IOException; > > > +import java.io.InputStream; > > > +import java.security.MessageDigest; > > > +import java.util.ArrayList; > > > +import java.util.List; > > > + > > > + > > > +/** > > > + * The {@link ObservableInputStream} allows, that an InputStream may > be > > > consumed > > > + * by other receivers, apart from the thread, which is reading it. > > > + * The other consumers are implemented as instances of {@link > > Observer}. A > > > + * typical application may be the generation of a {@link > MessageDigest} > > > on the > > > + * fly. > > > + * {@code Note}: The {@link ObservableInputStream} is not > > thread > > > safe, > > > + * as instances of InputStream usually aren't. > > > + * If you must access the stream from multiple threads, then > > > synchronization, locking, > > > + * or a similar means must be used. > > > + * @see MessageDigestCalculatingInputStream > > > + */ > > > +public class ObservableInputStream extends ProxyInputStream { > > > + public static abstract class Observer { > > > + /** Called to indicate, that {@link InputStream#read()} has > been > > > invoked > > > + * on the {@link ObservableInputStream}, and will return a > > value. > > > + * @param pByte The value, which is being returned. This will > > > never be -1 (EOF), > > > + * because, in that case, {link #finished()} will be > invoked > > > instead. > > > + */ > > > + void data(int pByte) throws IOException {} > > > + /** Called to indicate, that {@link InputStream#read(byte[])}, > > or > > > + * {@link InputStream#read(byte[], int, int)} have been > called, > > > and are about to > > > + * invoke data. > > > + * @param pBuffer The byte array, which has been passed to the > > > read call, and where > > > + * data has been stored. > > > + * @param pOffset The offset within the byte array, where data > > > has been stored. > > > + * @param pLength The number of bytes, which have been stored > in > > > the byte array. > > > + */ > > > + void data(byte[] pBuffer, int pOffset, int pLength) throws > > > IOException {} > > > + /** Called to indicate, that EOF has been seen on the > underlying > > > stream. > > > + * This method may be called multiple times, if the reader > keeps > > > invoking > > > + * either of the read methods, and they will consequently keep > > > returning > > > + * EOF. > > > + */ > > > + void finished() throws IOException {} > > > + /** Called to indicate, that the {@link ObservableInputStream} > > > has been closed. > > > + */ > > > + void closed() throws IOException {} > > > + /** > > > + * Called to indicate, that an error occurred on the > underlying > > > stream. > > > + */ > > > + void error(IOException pException) throws IOException { throw > > > pException; } > > > + } > > > + > > > + private final List observers = new ArrayList<>(); > > > + > > > + public ObservableInputStream(InputStream pProxy) { > > > + super(pProxy); > > > + } > > > + > > > + public void add(Observer pObserver) { > > > + observers.add(pObserver); > > > + } > > > + > > > + public void remove(Observer pObserver) { > > > + observers.remove(pObserver); > > > + } > > > + > > > + public void removeAllObservers() { > > > + observers.clear(); > > > + } > > > + > > > + @Override > > > + public int read() throws IOException { > > > + int result = 0; > > > + IOException ioe = null; > > > + try { > > > + result = super.read(); > > > + } catch (IOException pException) { > > > + ioe = pException; > > > + } > > > + if (ioe != null) { > > > + noteError(ioe); > > > + } else if (result == -1) { > > > + noteFinished(); > > > + } else { > > > + noteDataByte(result); > > > + } > > > + return result; > > > + } > > > + > > > + @Override > > > + public int read(byte[] pBuffer) throws IOException { > > > + int result = 0; > > > + IOException ioe = null; > > > + try { > > > + result = super.read(pBuffer); > > > + } catch (IOException pException) { > > > + ioe = pException; > > > + } > > > + if (ioe != null) { > > > + noteError(ioe); > > > + } else if (result == -1) { > > > + noteFinished(); > > > + } else if (result > 0) { > > > + noteDataBytes(pBuffer, 0, result); > > > + } > > > + return result; > > > + } > > > + > > > + @Override > > > + public int read(byte[] pBuffer, int pOffset, int pLength) throws > > > IOException { > > > + int result = 0; > > > + IOException ioe = null; > > > + try { > > > + result = super.read(pBuffer, pOffset, pLength); > > > + } catch (IOException pException) { > > > + ioe = pException; > > > + } > > > + if (ioe != null) { > > > + noteError(ioe); > > > + } else if (result == -1) { > > > + noteFinished(); > > > + } else if (result > 0) { > > > + noteDataBytes(pBuffer, pOffset, result); > > > + } > > > + return result; > > > + } > > > + > > > + /** Notifies the observers by invoking {@link > > > Observer#data(byte[],int,int)} > > > + * with the given arguments. > > > + * @param pBuffer Passed to the observers. > > > + * @param pOffset Passed to the observers. > > > + * @param pLength Passed to the observers. > > > + * @throws IOException Some observer has thrown an exception, > which > > > is being > > > + * passed down. > > > + */ > > > + protected void noteDataBytes(byte[] pBuffer, int pOffset, int > > > pLength) throws IOException { > > > + for (Observer observer : getObservers()) { > > > + observer.data(pBuffer, pOffset, pLength); > > > + } > > > + } > > > + > > > + /** Notifies the observers by invoking {@link > Observer#finished()}. > > > + * @throws IOException Some observer has thrown an exception, > which > > > is being > > > + * passed down. > > > + */ > > > + protected void noteFinished() throws IOException { > > > + for (Observer observer : getObservers()) { > > > + observer.finished(); > > > + } > > > + } > > > + > > > + /** Notifies the observers by invoking {@link Observer#data(int)} > > > + * with the given arguments. > > > + * @param pDataByte Passed to the observers. > > > + * @throws IOException Some observer has thrown an exception, > which > > > is being > > > + * passed down. > > > + */ > > > + protected void noteDataByte(int pDataByte) throws IOException { > > > + for (Observer observer : getObservers()) { > > > + observer.data(pDataByte); > > > + } > > > + } > > > + > > > + /** Notifies the observers by invoking {@link > > > Observer#error(IOException)} > > > + * with the given argument. > > > + * @param pException Passed to the observers. > > > + * @throws IOException Some observer has thrown an exception, > which > > > is being > > > + * passed down. This may be the same exception, which has been > > > passed as an > > > + * argument. > > > + */ > > > + protected void noteError(IOException pException) throws > IOException > > { > > > + for (Observer observer : getObservers()) { > > > + observer.error(pException); > > > + } > > > + } > > > + > > > + /** Notifies the observers by invoking {@link > Observer#finished()}. > > > + * @throws IOException Some observer has thrown an exception, > which > > > is being > > > + * passed down. > > > + */ > > > + protected void noteClosed() throws IOException { > > > + for (Observer observer : getObservers()) { > > > + observer.closed(); > > > + } > > > + } > > > + > > > + protected List getObservers() { > > > + return observers; > > > + } > > > + > > > + @Override > > > + public void close() throws IOException { > > > + IOException ioe = null; > > > + try { > > > + super.close(); > > > + } catch (IOException e) { > > > + ioe = e; > > > + } > > > + if (ioe == null) { > > > + noteClosed(); > > > + } else { > > > + noteError(ioe); > > > + } > > > + } > > > + > > > + /** Reads all data from the underlying {@link InputStream}, while > > > notifying the > > > + * observers. > > > + * @throws IOException The underlying {@link InputStream}, or > either > > > of the > > > + * observers has thrown an exception. > > > + */ > > > + public void consume() throws IOException { > > > + final byte[] buffer = new byte[8192]; > > > + for (;;) { > > > + final int res = read(buffer); > > > + if (res == -1) { > > > + return; > > > + } > > > + } > > > + } > > > + > > > +} > > > > > > > > > > > > -- > Matt Sicker > --001a1142e82a2f38c8053cf1b2ca--