PR:
Make methods in ObservableInputStream.Obsever public.
MODIFY
src/changes/changes.xml
src/changes/changes.xml
@@ -47,6 +47,9 @@ The <action> type attribute can be add,update,fix,remove.
<body>
<!-- The release date is the date RC is cut -->
<release version="2.7" date="tba" description="tba">
+ <action issue="IO-582" dev="jochen" type="fix" due-to="Bruno Palos">
+ Make methods in ObservableInputStream.Obsever public.
+ </action>
<action issue="IO-535" dev="pschumacher" type="fix" due-to="Svetlin Zarev, Anthony Raymond">
Thread bug in FileAlterationMonitor#stop(int)
</action>

MODIFY
src/main/java/org/apache/commons/io/input/MessageDigestCalculatingInputStream.java
src/main/java/org/apache/commons/io/input/MessageDigestCalculatingInputStream.java
@@ -46,11 +46,13 @@ public MessageDigestMaintainingObserver(final MessageDigest pMd) {
}
@Override
+ public
void data(final int pByte) throws IOException {
md.update((byte) pByte);
}
@Override
+ public
void data(final byte[] pBuffer, final int pOffset, final int pLength) throws IOException {
md.update(pBuffer, pOffset, pLength);
}

MODIFY
src/main/java/org/apache/commons/io/input/ObservableInputStream.java
src/main/java/org/apache/commons/io/input/ObservableInputStream.java
* because, in that case, {@link #finished()} will be invoked instead.
* @throws IOException if an i/o-error occurs
*/
- void data(final int pByte) throws IOException {}
+ public void data(final 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
@@ -55,7 +55,7 @@ void data(final int pByte) throws IOException {}
* @param pLength The number of bytes, which have been stored in the byte array.
* @throws IOException if an i/o-error occurs
*/
- void data(final byte[] pBuffer, final int pOffset, final int pLength) throws IOException {}
+ public void data(final byte[] pBuffer, final int pOffset, final 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
@@ -63,18 +63,18 @@ void data(final byte[] pBuffer, final int pOffset, final int pLength) throws IOE
* EOF.
* @throws IOException if an i/o-error occurs
*/
- void finished() throws IOException {}
+ public void finished() throws IOException {}
/** Called to indicate, that the {@link ObservableInputStream} has been closed.
* @throws IOException if an i/o-error occurs
*/
- void closed() throws IOException {}
+ public void closed() throws IOException {}
/**
* Called to indicate, that an error occurred on the underlying stream.
* @throws IOException if an i/o-error occurs
*/
- void error(final IOException pException) throws IOException { throw pException; }
+ public void error(final IOException pException) throws IOException { throw pException; }
}
private final List<Observer> observers = new ArrayList<>();

MODIFY
src/test/java/org/apache/commons/io/input/ObservableInputStreamTest.java
src/test/java/org/apache/commons/io/input/ObservableInputStreamTest.java
private boolean closed;
@Override
+ public
void data(final int pByte) throws IOException {
super.data(pByte);
lastByteSeen = pByte;
}
@Override
+ public
void finished() throws IOException {
super.finished();
finished = true;
}
@Override
+ public
void closed() throws IOException {
super.closed();
closed = true;
@@ -56,6 +59,7 @@ void closed() throws IOException {
private int length = -1;
@Override
+ public
void data(final byte[] pBuffer, final int pOffset, final int pLength) throws IOException {
super.data(pBuffer, pOffset, pLength);
buffer = pBuffer;

PR: IO-582

Make methods in ObservableInputStream.Obsever public.