Overview | Package | Class | Tree | Deprecated | Index | Help
| Copyright 2012-04-26 Werner Randelshofer
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.monte.media.binary
Class FileBasedBinaryModel

    java.lang.Object
      org.monte.media.binary.FileBasedBinaryModel

All Implemented Interfaces:
  BinaryModel

    public class FileBasedBinaryModel

extends java.lang.Object
implements BinaryModel

FileBasedBinaryModel.

FIXME - The file based binary model may grow infinitely large.

Version:
  1.0.1 2010-05-24 Method getBytes sometimes returned invalid length.
  1.0 2010-04-09 Created.
Author:
  Werner Randelshofer

Constructor Summary
`FileBasedBinaryModel(java.io.File file)`
`FileBasedBinaryModel(java.io.File file, long offset, long length)`

Method Summary
`void` | `close()` Closes the model and disposes all resources.
`void` | `finalize()`
`int` | `getBytes(long off, int len, byte[] target)` Gets a sequence of bytes and copies them into the supplied byte array.
`long` | `getLength()` Returns the total length of the binary data.
`java.lang.String` | `toString()`

Methods inherited from class java.lang.Object
`clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Constructor Detail

### FileBasedBinaryModel

    public FileBasedBinaryModel(java.io.File file)
                         throws java.io.IOException

Throws:
  `java.io.IOException`

### FileBasedBinaryModel

    public FileBasedBinaryModel(java.io.File file,
                                long offset,
                                long length)
                         throws java.io.IOException

Throws:
  `java.io.IOException`

Method Detail

### toString

    public java.lang.String toString()

  Overrides:
    `toString` in class `java.lang.Object`

### getLength

    public long getLength()

  Description copied from interface: `BinaryModel`
  Returns the total length of the binary data.

  Specified by:
    `getLength` in interface `BinaryModel`

### getBytes

    public int getBytes(long off,
                        int len,
                        byte[] target)

  Description copied from interface: `BinaryModel`
  Gets a sequence of bytes and copies them into the supplied byte array.

  Specified by:
    `getBytes` in interface `BinaryModel`
  Parameters:
    `off` - the starting offset >= 0
    `len` - the number of bytes >= 0 && <= size - offset
    `target` - the target array to copy into

### close

    public void close()

  Description copied from interface: `BinaryModel`
  Closes the model and disposes all resources.

  Specified by:
    `close` in interface `BinaryModel`

### finalize

    public void finalize()

  Overrides:
    `finalize` in class `java.lang.Object`

Overview | Package | Class | Tree | Deprecated | Index | Help
| Copyright 2012-04-26 Werner Randelshofer
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD