NIFI-8616 - Updated DelimitedInputStream to extend the FilterInputStream class. (#5203)

This commit is contained in:
thenatog 2021-07-07 18:36:58 -04:00 committed by GitHub
parent ea31634ea7
commit 775130580a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 9 deletions

View File

@ -16,28 +16,22 @@
*/
package org.apache.nifi.event.transport.netty;
import java.io.IOException;
import java.io.FilterInputStream;
import java.io.InputStream;
/**
* A delimited InputStream which retains a delimiter for later use
*/
public class DelimitedInputStream extends InputStream {
public class DelimitedInputStream extends FilterInputStream {
private final InputStream in;
private final byte[] delimiter;
public DelimitedInputStream(final InputStream in, final byte[] delimiter) {
this.in = in;
super(in);
this.delimiter = delimiter;
}
public byte[] getDelimiter() {
return delimiter;
}
@Override
public int read() throws IOException {
return in.read();
}
}