01: /*-
02: * See the file LICENSE for redistribution information.
03: *
04: * Copyright (c) 2002,2008 Oracle. All rights reserved.
05: *
06: * $Id: LogSource.java,v 1.22.2.3 2008/01/07 15:14:13 cwl Exp $
07: */
08:
09: package com.sleepycat.je.log;
10:
11: import java.io.IOException;
12: import java.nio.ByteBuffer;
13:
14: import com.sleepycat.je.DatabaseException;
15:
16: /**
17: * A class that implements LogSource can return portions of the log.
18: * Is public for unit testing.
19: */
20: public interface LogSource {
21:
22: /**
23: * We're done with this log source.
24: */
25: void release() throws DatabaseException;
26:
27: /**
28: * Fill the destination byte array with bytes. The offset indicates the
29: * absolute log file position.
30: */
31: ByteBuffer getBytes(long fileOffset) throws IOException;
32:
33: /**
34: * Fill the destination byte array with the requested number of bytes. The
35: * offset indicates the absolute position in the log file.
36: */
37: ByteBuffer getBytes(long fileOffset, int numBytes)
38: throws IOException;
39: }
|