org.codehaus.swizzle.stream
Class TruncateInputStream
java.lang.Object
java.io.InputStream
org.codehaus.swizzle.stream.PushbackInputStream
org.codehaus.swizzle.stream.TruncateInputStream
- All Implemented Interfaces:
- Closeable, PushbackBuffer
public class TruncateInputStream
- extends PushbackInputStream
Reads from the underlying stream up until the token passed in.
After the token passed in is read, only -1 will be returned without
affecting the underlying stream.
- Version:
- $Revision$ $Date$
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TruncateInputStream
public TruncateInputStream(InputStream in,
String end)
TruncateInputStream
public TruncateInputStream(InputStream delegate,
String end,
boolean caseSensitive)
getEndToken
public String getEndToken()
getNextByte
protected int getNextByte()
throws IOException
- Overrides:
getNextByte in class PushbackInputStream
- Throws:
IOException
getBuffer
public byte[] getBuffer()
- Gets the current contents of the buffer
- Specified by:
getBuffer in interface PushbackBuffer- Overrides:
getBuffer in class PushbackInputStream
Copyright © 2011 The Codehaus Foundation. All Rights Reserved.