Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.codehaus.activemq.message.util
Class FileDataBlock

    java.lang.Object
      org.codehaus.activemq.message.util.FileDataBlock

class FileDataBlock
extends java.lang.Object

Simply writes/reads data from a RandomAccessFile

Version:
  $Revision: 1.1 $

Constructor Summary
`(package private)` | `FileDataBlock(java.io.File file, long maxSize)` Constructor

Method Summary
`(package private) void` | `close()` close and deletes the block
`(package private) boolean` | `isEnoughSpace(byte[] data)` test to if there is enough room in the block to write the data
`(package private) byte[]` | `read()` read next chunk of data
`(package private) void` | `write(byte[] data)` Write data to the end of the block

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

Constructor Detail

### FileDataBlock

    FileDataBlock(java.io.File file,
                  long maxSize)
            throws java.io.IOException

  Constructor

Parameters:
  `file` - File handle
  `maxSize` - maximum size (in bytes) for the block
Throws:
  `java.io.IOException`

Method Detail

### close

    void close()
         throws java.io.IOException

  close and deletes the block

  Throws:
    `java.io.IOException`

### isEnoughSpace

    boolean isEnoughSpace(byte[] data)
                    throws java.io.IOException

  test to if there is enough room in the block to write the data

  Parameters:
    `data` - bytes to be written
  Returns:
    true if there is enough space left in the block to write the data
  Throws:
    `java.io.IOException`

### write

    void write(byte[] data)
         throws java.io.IOException

  Write data to the end of the block

  Parameters:
    `data` - the bytes to write
  Throws:
    `java.io.IOException`

### read

    byte[] read()
          throws java.io.IOException

  read next chunk of data

  Returns:
    next chunk of data or null if no more to read
  Throws:
    `java.io.IOException`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2004 Protique, Ltd.. All Rights Reserved.