liquibase.io
Class EmptyLineAndCommentSkippingInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by java.io.FilterInputStream
          extended by java.io.BufferedInputStream
              extended by liquibase.io.EmptyLineAndCommentSkippingInputStream
All Implemented Interfaces:
Closeable

public class EmptyLineAndCommentSkippingInputStream
extends BufferedInputStream

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
static int MAX_CHAR_SIZE_IN_BYTES
           
 
Fields inherited from class java.io.BufferedInputStream
buf, count, marklimit, markpos, pos
 
Fields inherited from class java.io.FilterInputStream
in
 
Constructor Summary
EmptyLineAndCommentSkippingInputStream(InputStream in, String commentLineStartsWith)
          Creates Input stream that does not read (skips) lines starting with commentLineStartsWith
 
Method Summary
 int read()
           
 
Methods inherited from class java.io.BufferedInputStream
available, close, mark, markSupported, read, reset, skip
 
Methods inherited from class java.io.FilterInputStream
read
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAX_CHAR_SIZE_IN_BYTES

public static final int MAX_CHAR_SIZE_IN_BYTES
See Also:
Constant Field Values
Constructor Detail

EmptyLineAndCommentSkippingInputStream

public EmptyLineAndCommentSkippingInputStream(InputStream in,
                                              String commentLineStartsWith)
Creates Input stream that does not read (skips) lines starting with commentLineStartsWith

Parameters:
in - original input stream
commentLineStartsWith - comment line pattern (if empty or null, comments will not be enabled)
Method Detail

read

public int read()
         throws IOException
Overrides:
read in class BufferedInputStream
Throws:
IOException


Copyright © 2016 Liquibase.org. All rights reserved.