GF4J 0.9.4 Beta

gameframe.engines.jdk11x
Class CLoopingSoundStream

java.lang.Object
  |
  +--java.io.InputStream
        |
        +--gameframe.engines.jdk11x.CLoopingSoundStream

public class CLoopingSoundStream
extends java.io.InputStream

Looping sound stream that uses the given CSoundStream as the source for audio data. This means that the sample data is not duplicated (which of course saves memory).

Since:
GameFrame for Java 0.9
Version:
GameFrame for Java 0.9.4

Field Summary
private  CSoundStream m_soundStream
          The sound stream object that is used as the base for looping sound stream.
 
Fields inherited from class java.io.InputStream
SKIP_BUFFER_SIZE, skipBuffer
 
Constructor Summary
CLoopingSoundStream(CSoundStream soundStream)
          Constructs a looping sound stream from the given sound stream.
 
Method Summary
 int available()
          Redirected to underlying CSoundStream object.
 void close()
          Redirected to underlying CSoundStream object.
 void mark(int readLimit)
          Redirected to underlying CSoundStream object.
 boolean markSupported()
          Redirected to underlying CSoundStream object.
 int read()
          Overrides the read method of input stream to read from the underlying sound stream with looping.
 int read(byte[] aBuffer)
          Overrides the read method of input stream to read from the underlying sound stream with looping.
 int read(byte[] aBuffer, int offset, int length)
          Overrides the read method of input stream to read from the underlying sound stream with looping.
 void reset()
          Redirected to underlying CSoundStream object.
 long skip(long numSkippedBytes)
          Redirected to underlying CSoundStream object.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

m_soundStream

private CSoundStream m_soundStream
The sound stream object that is used as the base for looping sound stream.
Constructor Detail

CLoopingSoundStream

public CLoopingSoundStream(CSoundStream soundStream)
Constructs a looping sound stream from the given sound stream.
Parameters:
soundStream - The sound stream used as the base.
Method Detail

read

public int read()
         throws java.io.IOException
Overrides the read method of input stream to read from the underlying sound stream with looping.
Overrides:
read in class java.io.InputStream
Returns:
The read value.

read

public int read(byte[] aBuffer)
         throws java.io.IOException
Overrides the read method of input stream to read from the underlying sound stream with looping.
Overrides:
read in class java.io.InputStream
Parameters:
aBuffer - The buffer to read into.
Returns:
The number of read values.

read

public int read(byte[] aBuffer,
                int offset,
                int length)
         throws java.io.IOException
Overrides the read method of input stream to read from the underlying sound stream with looping.
Overrides:
read in class java.io.InputStream
Parameters:
aBuffer - The buffer to read into.
offset - The offset to the buffer.
length - The length of read.
Returns:
The number of total read values.

skip

public long skip(long numSkippedBytes)
          throws java.io.IOException
Redirected to underlying CSoundStream object.
Overrides:
skip in class java.io.InputStream

available

public int available()
              throws java.io.IOException
Redirected to underlying CSoundStream object.
Overrides:
available in class java.io.InputStream

close

public void close()
           throws java.io.IOException
Redirected to underlying CSoundStream object.
Overrides:
close in class java.io.InputStream

mark

public void mark(int readLimit)
Redirected to underlying CSoundStream object.
Overrides:
mark in class java.io.InputStream

reset

public void reset()
           throws java.io.IOException
Redirected to underlying CSoundStream object.
Overrides:
reset in class java.io.InputStream

markSupported

public boolean markSupported()
Redirected to underlying CSoundStream object.
Overrides:
markSupported in class java.io.InputStream

GF4J 0.9.4 Beta