com.sun.media.sound
Class ModelByteBuffer

java.lang.Object
  extended by com.sun.media.sound.ModelByteBuffer

public class ModelByteBuffer
extends java.lang.Object

This class is a pointer to a binary array either in memory or on disk.

Author:
Karl Helgason

Constructor Summary
ModelByteBuffer(byte[] buffer)
           
ModelByteBuffer(byte[] buffer, int offset, int len)
           
ModelByteBuffer(java.io.File file)
           
ModelByteBuffer(java.io.File file, long offset, long len)
           
 
Method Summary
 byte[] array()
           
 long arrayOffset()
           
 long capacity()
           
 java.io.File getFile()
           
 long getFilePointer()
           
 java.io.InputStream getInputStream()
           
 ModelByteBuffer getRoot()
           
 void load()
           
static void loadAll(java.util.Collection<ModelByteBuffer> col)
           
 ModelByteBuffer subbuffer(long beginIndex)
           
 ModelByteBuffer subbuffer(long beginIndex, long endIndex)
           
 ModelByteBuffer subbuffer(long beginIndex, long endIndex, boolean independent)
           
 void unload()
           
 void writeTo(java.io.OutputStream out)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ModelByteBuffer

public ModelByteBuffer(byte[] buffer)

ModelByteBuffer

public ModelByteBuffer(byte[] buffer,
                       int offset,
                       int len)

ModelByteBuffer

public ModelByteBuffer(java.io.File file)

ModelByteBuffer

public ModelByteBuffer(java.io.File file,
                       long offset,
                       long len)
Method Detail

writeTo

public void writeTo(java.io.OutputStream out)
             throws java.io.IOException
Throws:
java.io.IOException

getInputStream

public java.io.InputStream getInputStream()

subbuffer

public ModelByteBuffer subbuffer(long beginIndex)

subbuffer

public ModelByteBuffer subbuffer(long beginIndex,
                                 long endIndex)

subbuffer

public ModelByteBuffer subbuffer(long beginIndex,
                                 long endIndex,
                                 boolean independent)

array

public byte[] array()

arrayOffset

public long arrayOffset()

capacity

public long capacity()

getRoot

public ModelByteBuffer getRoot()

getFile

public java.io.File getFile()

getFilePointer

public long getFilePointer()

loadAll

public static void loadAll(java.util.Collection<ModelByteBuffer> col)
                    throws java.io.IOException
Throws:
java.io.IOException

load

public void load()
          throws java.io.IOException
Throws:
java.io.IOException

unload

public void unload()