Top Description Fields Constructors Methods
liquibase.io

public Class EmptyLineAndCommentSkippingInputStream

extends BufferedInputStream
Class Inheritance
Imports
liquibase.util.StringUtil, java.io.BufferedInputStream, .IOException, .InputStream

Input stream that does not read (skips) lines starting with commentPattern and line endings. read() method will not return either line endings or commented lines.

Field Summary

Modifier and TypeField and Description
private final String
private final boolean
private int
public static final int
Inherited from java.io.BufferedInputStream:
bufcountmarklimitmarkpospos

Constructor Summary

AccessConstructor and Description
public
EmptyLineAndCommentSkippingInputStream(InputStream
original input stream
in
,
String
comment line pattern (if empty or null, comments will not be enabled)
commentLineStartsWith
)

Creates Input stream that does not read (skips) lines starting with commentLineStartsWith

Method Summary

Modifier and TypeMethod and Description
public synchronized int
read()

Overrides java.io.BufferedInputStream.read.

See the general contract of the read method of InputStream.

private int
read(final int lastRead, final boolean lookAhead)

Inherited from java.io.BufferedInputStream:
availableclosemarkmarkSupportedreadresetskiptransferTo

Field Detail

commentLineStartsWithback to summary
private final String commentLineStartsWith
commentSkipEnabledback to summary
private final boolean commentSkipEnabled
lastReadback to summary
private int lastRead
MAX_CHAR_SIZE_IN_BYTESback to summary
public static final int MAX_CHAR_SIZE_IN_BYTES

Constructor Detail

EmptyLineAndCommentSkippingInputStreamback to summary
public EmptyLineAndCommentSkippingInputStream(InputStream in, String commentLineStartsWith)

Creates Input stream that does not read (skips) lines starting with commentLineStartsWith

Parameters
in:InputStream

original input stream

commentLineStartsWith:String

comment line pattern (if empty or null, comments will not be enabled)

Method Detail

readback to summary
public synchronized int read() throws IOException

Overrides java.io.BufferedInputStream.read.

Doc from java.io.BufferedInputStream.read.

See the general contract of the read method of InputStream.

Returns:int

the next byte of data, or -1 if the end of the stream is reached.

Annotations
@Override
Exceptions
IOException:
if this input stream has been closed by invoking its close() method, or an I/O error occurs.
readback to summary
private int read(final int lastRead, final boolean lookAhead) throws IOException