Xj3D VRML/X3D Code API

org.web3d.vrml.nodes.content
Class StreamContentContainer

java.lang.Object
  extended byorg.web3d.vrml.nodes.content.StreamContentContainer

public class StreamContentContainer
extends java.lang.Object

This is a utility class used by content handlers. Content handlers return objects that are reused by nodes in the scene. This object type can be used to pass an InputStream to the nodes. Each client will request a new input stream using getInputStream.


Constructor Summary
StreamContentContainer(java.io.InputStream inputStream, int length, int format, int frequency)
          Construct a new content container from an input stream.
 
Method Summary
 byte[] getBuffer()
          Returns a direct reference to the underlying buffer.
 int getFormat()
          Get the format.
 int getFrequency()
          Get the frequency of the content.
 java.io.InputStream getInputStream()
          Returns an input stream associated with this resource.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StreamContentContainer

public StreamContentContainer(java.io.InputStream inputStream,
                              int length,
                              int format,
                              int frequency)
                       throws java.io.IOException
Construct a new content container from an input stream. The content container is a copy of the entire byte stream. Calls to getInputStream will return new InputStreams which are byte-copies of the original input stream.

If length bytes cannot be read from the input stream, an IOException will be thrown.

Parameters:
inputStream - input stream to read data from
length - number of bytes of data to read from the input stream
format - The format, defined in ALConstants
frequency - The frequency
Throws:
java.io.IOException - either too few bytes were read or read failed
Method Detail

getInputStream

public java.io.InputStream getInputStream()
Returns an input stream associated with this resource. If the resource is cachable (canCache returns true) this method may be called more than once, and each call will return a new stream.

Returns:
Returns a new InputStream which will return same byte-stream as original InputStream.

getBuffer

public byte[] getBuffer()
Returns a direct reference to the underlying buffer.

Returns:
The underlying buffer.

getFormat

public int getFormat()
Get the format. Defined in OpenAL.ALConstants.

Returns:
The format of the audio data

getFrequency

public int getFrequency()
Get the frequency of the content.

Returns:
The frequency.

Xj3D VRML/X3D Code API

Copyright © 2001 - 2005 Web3D Consortium