2
* See the file LICENSE for redistribution information.
4
* Copyright (c) 1997-2002
5
* Sleepycat Software. All rights reserved.
10
package com.sleepycat.db;
11
import java.io.OutputStream;
12
import java.io.IOException;
16
* @author Donald D. Anderson
18
* This class is not public, as it is only used internally
19
* by Db to implement a default error handler.
22
/*package*/ class DbOutputStreamErrcall implements DbErrcall
24
DbOutputStreamErrcall(OutputStream stream)
26
this.stream_ = stream;
29
// errcall implements DbErrcall
31
public void errcall(String prefix, String buffer)
35
stream_.write(prefix.getBytes());
36
stream_.write((new String(": ")).getBytes());
38
stream_.write(buffer.getBytes());
39
stream_.write((new String("\n")).getBytes());
41
catch (IOException e) {
44
// Do our best to report the problem by other means.
46
System.err.println("DbOutputStreamErrcall Exception: " + e);
48
System.err.print(prefix + ": ");
49
System.err.println(buffer + "\n");
55
private OutputStream stream_;
58
// end of DbOutputStreamErrcall.java