org.jnetstream.capture.file
Interface FileOptions


public interface FileOptions

Various options for the capture file. These options change the runtime properties of the open capture file and affect performance and functionality of the capture file API.

Author:
Mark Bednarczyk, Sly Technologies, Inc.

Nested Class Summary
static class FileOptions.FileProperty
          Various properties that can be applied to capture files.
static class FileOptions.MemoryModel
          Options for changing the memory model used by the implementation.
 
Method Summary
 int getBufferSize()
          Returns the current prefetch buffer size.
 java.util.Set<FileOptions.FileProperty> getFileProperties()
          Gets the immutable set of currently set properties.
 java.nio.channels.FileChannel.MapMode getMemoryMapMode()
           
 FileOptions.MemoryModel getMemoryModel()
          Gets the current active memory model.
 void setBufferSize(int size)
          Changes the size of the prefetch buffer for the current MemoryModel.
 void setFileProperty(FileOptions.FileProperty property)
          Sets a new property on the file.
 void setMemoryMapMode(java.nio.channels.FileChannel.MapMode mode)
          Sets the memory mapping mode for the FileOptions.MemoryModel.MappedFile mode.
 void setMemoryModel(FileOptions.MemoryModel model)
          Changes the current memory model to the one specified.
 

Method Detail

setMemoryModel

void setMemoryModel(FileOptions.MemoryModel model)
Changes the current memory model to the one specified. See each model for detailed description.

Parameters:
model - the model to change to
See Also:
FileOptions.MemoryModel.ByteArray, FileOptions.MemoryModel.DirectBuffer, FileOptions.MemoryModel.MappedFile

getMemoryModel

FileOptions.MemoryModel getMemoryModel()
Gets the current active memory model.

Returns:
memory model that is currently active
See Also:
FileOptions.MemoryModel.ByteArray, FileOptions.MemoryModel.DirectBuffer, FileOptions.MemoryModel.MappedFile

setMemoryMapMode

void setMemoryMapMode(java.nio.channels.FileChannel.MapMode mode)
                      throws java.lang.IllegalArgumentException
Sets the memory mapping mode for the FileOptions.MemoryModel.MappedFile mode. If the model is not of the MappedFile type, illegalArgumentException is thrown.

Parameters:
mode - mode to set
Throws:
java.lang.IllegalArgumentException - thrown if model is not of MappedFile

getMemoryMapMode

java.nio.channels.FileChannel.MapMode getMemoryMapMode()

setBufferSize

void setBufferSize(int size)
Changes the size of the prefetch buffer for the current MemoryModel. The buffer size will have direct impact on the performance of the capture framework within jNetStream. Please note that appropriate buffer size is greatly different between each of the supported memory models. The buffer size can be set greater then the actual file size. This means that the entire file will be buffered at once. The buffer will be allocated exactly the size of the file and not over-allocated. So its safe to set huge buffers even on small files, as only the amount of buffer needed will be allocated.

Parameters:
size - new prefetch buffer size
See Also:
#ByteArray, #DirectBuffer, #MappedFile

getBufferSize

int getBufferSize()
Returns the current prefetch buffer size.

Returns:
size of the current buffer

setFileProperty

void setFileProperty(FileOptions.FileProperty property)
Sets a new property on the file.

Parameters:
property - property to set

getFileProperties

java.util.Set<FileOptions.FileProperty> getFileProperties()
Gets the immutable set of currently set properties.

Returns:
returns active properties