com.atlassian.core.util
Class ReusableBufferedInputStream
java.lang.Object
java.io.InputStream
java.io.FilterInputStream
java.io.BufferedInputStream
com.atlassian.core.util.ReusableBufferedInputStream
- All Implemented Interfaces:
- Closeable
public class ReusableBufferedInputStream
- extends BufferedInputStream
Decorated subclass of BufferedInputStream that can be read multiple times as it marks the stream
with Integer.MAX_VALUE and resets the stream when close() is called.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ReusableBufferedInputStream
public ReusableBufferedInputStream(InputStream inputStream)
close
public void close()
throws IOException
- Calls
BufferedInputStream.reset() instead of closing the stream.
- Specified by:
close in interface Closeable- Overrides:
close in class BufferedInputStream
- Throws:
IOException
destroy
public void destroy()
throws IOException
- Actually closes the ReusableBufferedInputStream by calling
BufferedInputStream.close().
- Throws:
IOException
Copyright © 2015 Atlassian. All rights reserved.