Class ExtendedBufferedInputStream
- java.lang.Object
-
- java.io.InputStream
-
- java.io.FilterInputStream
-
- java.io.BufferedInputStream
-
- com.sedmelluq.discord.lavaplayer.tools.io.ExtendedBufferedInputStream
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable
public class ExtendedBufferedInputStream extends java.io.BufferedInputStreamA buffered input stream that gives with the ability to get the number of bytes left in the buffer and a method for discarding the buffer.
-
-
Constructor Summary
Constructors Constructor Description ExtendedBufferedInputStream(java.io.InputStream in)ExtendedBufferedInputStream(java.io.InputStream in, int size)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddiscardBuffer()Discard the remaining buffer.intgetBufferedByteCount()-
Methods inherited from class java.io.BufferedInputStream
available, close, mark, markSupported, read, read, reset, skip
-
-
-
-
Constructor Detail
-
ExtendedBufferedInputStream
public ExtendedBufferedInputStream(java.io.InputStream in)
- Parameters:
in- Underlying input stream
-
ExtendedBufferedInputStream
public ExtendedBufferedInputStream(java.io.InputStream in, int size)- Parameters:
in- Underlying input streamsize- Size of the buffer
-
-
Method Detail
-
getBufferedByteCount
public int getBufferedByteCount()
- Returns:
- The number of bytes left in the buffer. This is useful for calculating the actual position in the buffer if the position in the underlying buffer is known.
-
discardBuffer
public void discardBuffer()
Discard the remaining buffer. This should be called after seek has been performed on the underlying stream.
-
-