01: /*-
02: * See the file LICENSE for redistribution information.
03: *
04: * Copyright (c) 2002,2008 Oracle. All rights reserved.
05: *
06: * $Id: StringDbt.java,v 1.12.2.3 2008/01/07 15:14:34 cwl Exp $
07: */
08:
09: package com.sleepycat.je.util;
10:
11: import com.sleepycat.je.DatabaseEntry;
12:
13: public class StringDbt extends DatabaseEntry {
14: public StringDbt() {
15: }
16:
17: public StringDbt(String value) {
18: setString(value);
19: }
20:
21: public StringDbt(byte[] value) {
22: setData(value);
23: }
24:
25: public void setString(String value) {
26: byte[] data = value.getBytes();
27: setData(data);
28: }
29:
30: public String getString() {
31: return new String(getData(), 0, getSize());
32: }
33:
34: public String toString() {
35: return getString();
36: }
37: }
|