Skip to content

Commit 9a2c820

Browse files
committed
CODEC-138 Complete FilterInputStream interface for BaseNCodecInputStream
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/codec/trunk@1308606 13f79535-47bb-0310-9956-ffa450edef68
1 parent 1ade8d5 commit 9a2c820

2 files changed

Lines changed: 27 additions & 2 deletions

File tree

src/changes/changes.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@
3131
</release>
3232
-->
3333
<release version="1.7" date="TBD" description="Feature and fix release.">
34+
<action dev="sebb" type="fix" issue="CODEC-138">
35+
Complete FilterInputStream interface for BaseNCodecInputStream
36+
</action>
3437
<action dev="ggregory" type="fix" issue="CODEC-136">
3538
Use Charset objects when possible, create Charsets for required character encodings
3639
</action>

src/main/java/org/apache/commons/codec/binary/BaseNCodecInputStream.java

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,15 +59,26 @@ public int available() throws IOException {
5959
return baseNCodec.eof ? 0 : 1;
6060
}
6161

62+
/**
63+
* Marks the current position in this input stream.
64+
* <p>The {@link #mark} method of {@link BaseNCodecInputStream} does nothing.</p>
65+
*
66+
* @param readLimit the maximum limit of bytes that can be read before the mark position becomes invalid.
67+
*/
68+
@Override
69+
public synchronized void mark(int readLimit) {
70+
}
71+
6272
/**
6373
* {@inheritDoc}
64-
*
65-
* @return false
74+
*
75+
* @return always returns <code>false</code>
6676
*/
6777
@Override
6878
public boolean markSupported() {
6979
return false; // not an easy job to support marks
7080
}
81+
7182
/**
7283
* Reads one <code>byte</code> from this input stream.
7384
*
@@ -151,6 +162,17 @@ public int read(byte b[], int offset, int len) throws IOException {
151162
}
152163
}
153164

165+
/**
166+
* Repositions this stream to the position at the time the mark method was last called on this input stream.
167+
* <p>The {@link #reset} method of {@link BaseNCodecInputStream} does nothing except throw an {@link IOException}.</p>
168+
*
169+
* @throws IOException if this method is invoked
170+
*/
171+
@Override
172+
public synchronized void reset() throws IOException {
173+
throw new IOException("mark/reset not supported");
174+
}
175+
154176
/**
155177
* {@inheritDoc}
156178
*

0 commit comments

Comments
 (0)