mirror of
https://github.com/haraldk/TwelveMonkeys.git
synced 2025-08-02 11:05:29 -04:00
Minor enhancements to the Decoder API + tests.
This commit is contained in:
parent
a4dfb7a009
commit
9492ed67f1
@ -31,7 +31,7 @@ package com.twelvemonkeys.io.enc;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* Thrown by {@code Decoder}s when encoded data can not be decocded.
|
||||
* Thrown by {@code Decoder}s when encoded data can not be decoded.
|
||||
* <p/>
|
||||
*
|
||||
* @author <a href="mailto:harald.kuhr@gmail.com">Harald Kuhr</a>
|
||||
|
@ -47,13 +47,13 @@ import java.io.IOException;
|
||||
public interface Decoder {
|
||||
|
||||
/**
|
||||
* Decodes up to {@code pBuffer.length} bytes from the given inputstream,
|
||||
* Decodes up to {@code pBuffer.length} bytes from the given input stream,
|
||||
* into the given buffer.
|
||||
*
|
||||
* @param pStream the inputstream to decode data from
|
||||
* @param pStream the input stream to decode data from
|
||||
* @param pBuffer buffer to store the read data
|
||||
*
|
||||
* @return the total number of bytes read into the buffer, or {@code -1}
|
||||
* @return the total number of bytes read into the buffer, or {@code 0}
|
||||
* if there is no more data because the end of the stream has been reached.
|
||||
*
|
||||
* @throws DecodeException if encoded data is corrupt
|
||||
|
@ -143,7 +143,7 @@ public final class DecoderStream extends FilterInputStream {
|
||||
// Update offset (rest)
|
||||
off += dstLen;
|
||||
|
||||
// Inrease count
|
||||
// Increase count
|
||||
count += dstLen;
|
||||
}
|
||||
|
||||
|
@ -77,6 +77,10 @@ public abstract class DecoderAbstractTestCase extends ObjectAbstractTestCase {
|
||||
|
||||
@Test
|
||||
public final void testStreams() throws Exception {
|
||||
if (createCompatibleEncoder() == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (int i = 1; i < 100; i++) {
|
||||
try {
|
||||
runStreamTest(i);
|
||||
|
Loading…
x
Reference in New Issue
Block a user