public abstract class BufferedAudioInputStream
extends javax.sound.sampled.AudioInputStream
A class that extends BufferedAudioInputStream must implements the abstract methods
innerRead(byte[])
and innerAvailable()
.
Modifier and Type | Field and Description |
---|---|
static boolean |
DEBUG
Debug mode
|
protected java.io.InputStream |
input_stream
Input stream
|
Constructor and Description |
---|
BufferedAudioInputStream(javax.sound.sampled.AudioInputStream input_stream,
javax.sound.sampled.AudioFormat source_format,
int buffer_size)
Creates a new BufferedAudioInputStream.
|
Modifier and Type | Method and Description |
---|---|
int |
available() |
void |
close()
Closes this input stream and releases any system resources associated with the stream.
|
protected abstract int |
innerAvailable()
Gets the number of bytes that are currently available in the inner input stream for reading.
|
protected abstract int |
innerRead(byte[] buffer)
Reads a block of bytes from the inner input stream.
|
void |
mark(int readlimit)
Marks the current position in this input stream.
|
boolean |
markSupported()
Tests if this input stream supports the mark and reset methods.
|
protected void |
printOut(java.lang.String str)
Prints debugging information.
|
int |
read()
Reads the next byte of data from the input stream.
|
int |
read(byte[] buf)
Reads some number of bytes from the input stream and stores them into the buffer array b.
|
int |
read(byte[] buf,
int off,
int len)
Reads up to len bytes of data from the input stream into an array of bytes.
|
void |
reset()
Repositions this stream to the position at the time the mark method was last called on this input stream.
|
long |
skip(long n)
Skips over and discards n bytes of data from this input stream.
|
public static boolean DEBUG
protected java.io.InputStream input_stream
public BufferedAudioInputStream(javax.sound.sampled.AudioInputStream input_stream, javax.sound.sampled.AudioFormat source_format, int buffer_size)
protected abstract int innerRead(byte[] buffer)
buffer
- the buffer where the the bytes are read toprotected abstract int innerAvailable() throws java.io.IOException
java.io.IOException
public int available() throws java.io.IOException
available
in class javax.sound.sampled.AudioInputStream
java.io.IOException
public int read()
read
in class javax.sound.sampled.AudioInputStream
public int read(byte[] buf) throws java.io.IOException
read
in class javax.sound.sampled.AudioInputStream
buf
- the buffer where the the bytes are read tojava.io.IOException
public int read(byte[] buf, int off, int len) throws java.io.IOException
read
in class javax.sound.sampled.AudioInputStream
buf
- the buffer where the the bytes are read tooff
- the offset within the bufferlen
- the availble size within the buffer (from the offset)java.io.IOException
public long skip(long n)
skip
in class javax.sound.sampled.AudioInputStream
n
- the number of bytes to be skippedpublic void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class javax.sound.sampled.AudioInputStream
java.io.IOException
public boolean markSupported()
markSupported
in class javax.sound.sampled.AudioInputStream
public void mark(int readlimit)
mark
in class javax.sound.sampled.AudioInputStream
public void reset()
reset
in class javax.sound.sampled.AudioInputStream
protected void printOut(java.lang.String str)