1 /* ----------------------------------------------------------------------------
2  * This file was automatically generated by SWIG (http://www.swig.org).
3  * Version 3.0.12
4  *
5  * Do not make changes to this file unless you know what you are doing--modify
6  * the SWIG interface file instead.
7  * ----------------------------------------------------------------------------- */
8 
9 package com.sleepycat.db.internal;
10 
11 import com.sleepycat.db.*;
12 import java.util.Comparator;
13 
14 public class DbStream {
15   private transient long swigCPtr;
16   protected transient boolean swigCMemOwn;
17 
DbStream(long cPtr, boolean cMemoryOwn)18   protected DbStream(long cPtr, boolean cMemoryOwn) {
19     swigCMemOwn = cMemoryOwn;
20     swigCPtr = cPtr;
21   }
22 
getCPtr(DbStream obj)23   protected static long getCPtr(DbStream obj) {
24     return (obj == null) ? 0 : obj.swigCPtr;
25   }
26 
delete()27   /* package */ synchronized void delete() {
28     if (swigCPtr != 0) {
29       if (swigCMemOwn) {
30         swigCMemOwn = false;
31         throw new UnsupportedOperationException("C++ destructor does not have public access");
32       }
33       swigCPtr = 0;
34     }
35   }
36 
close(int flags)37 	public synchronized void close(int flags) throws DatabaseException {
38 		try {
39 			close0(flags);
40 		} finally {
41 			swigCPtr = 0;
42 		}
43 	}
44 
close0(int flags)45   /* package */ void close0(int flags) { db_javaJNI.DbStream_close0(swigCPtr, this, flags); }
46 
read(com.sleepycat.db.DatabaseEntry data, long offset, int size, int flags)47   public int read(com.sleepycat.db.DatabaseEntry data, long offset, int size, int flags) throws com.sleepycat.db.DatabaseException {
48     return db_javaJNI.DbStream_read(swigCPtr, this, data, offset, size, flags);
49   }
50 
size(int flags)51   public long size(int flags) throws com.sleepycat.db.DatabaseException {
52     return db_javaJNI.DbStream_size(swigCPtr, this, flags);
53   }
54 
write(com.sleepycat.db.DatabaseEntry data, long offset, int flags)55   public int write(com.sleepycat.db.DatabaseEntry data, long offset, int flags) throws com.sleepycat.db.DatabaseException {
56     return db_javaJNI.DbStream_write(swigCPtr, this, data, offset, flags);
57   }
58 
59 }
60