org.encog.parse
Class PeekableInputStream
- java.lang.Object
-
- java.io.InputStream
-
- org.encog.parse.PeekableInputStream
-
- All Implemented Interfaces:
- java.io.Closeable, java.lang.AutoCloseable
public class PeekableInputStream extends java.io.InputStreamThis is a special input stream that allows the program to peek one or more characters ahead in the file.
-
-
Field Summary
Fields Modifier and Type Field and Description static intINITIAL_DEPTHThe depth to peek.
-
Constructor Summary
Constructors Constructor and Description PeekableInputStream(java.io.InputStream is)The constructor accepts an InputStream to setup the object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description intpeek()Peek at the next character from the stream.intpeek(int depth)Peek at a specified depth.booleanpeek(java.lang.String str)Peek ahead and see if the specified string is present.intread()Read a single byte from the stream.longskip(long count)Skip the specified number of bytes.
-
-
-
Field Detail
-
INITIAL_DEPTH
public static final int INITIAL_DEPTH
The depth to peek.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
PeekableInputStream
public PeekableInputStream(java.io.InputStream is)
The constructor accepts an InputStream to setup the object.- Parameters:
is- The InputStream to parse.
-
-
Method Detail
-
peek
public int peek()
Peek at the next character from the stream.- Returns:
- The next character.
-
peek
public int peek(int depth)
Peek at a specified depth.- Parameters:
depth- The depth to check.- Returns:
- The character peeked at.
-
peek
public boolean peek(java.lang.String str)
Peek ahead and see if the specified string is present.- Parameters:
str- The string we are looking for.- Returns:
- True if the string was found.
-
read
public int read()
Read a single byte from the stream.- Specified by:
readin classjava.io.InputStream- Returns:
- The character that was read from the stream.
-
skip
public long skip(long count)
Skip the specified number of bytes.- Overrides:
skipin classjava.io.InputStream- Parameters:
count- The number of bytes to skip.- Returns:
- The actual number of bytes skipped.
-
-
DMelt 3.0 © DataMelt by jWork.ORG