Dump Utility Library

Copyright (C) 1997-2004 by Haruaki TAMADA All rights reserved.
Last Modified: Mon Jan 10 11:07:29 JST 2005

[ Japanese | English ]

Contents

Go to top of page

Abstract

I often create `dump' method. However, it is not specific code but routine code.

Thus, I am tiresome.

This library supports that routine code.

API Document [No Frames] Sorry, Japanese only.

ChangeLog

Go to top of page

Features

Go to top of page

License

GNU Lesser General Public License

Link about LGPL

Go to top of page

Download

dump-2.0.0
md5: b04b53e3706293448101c99bbd36faa2
dump-1.0.0
md5: d503a5ebba7aa218416e4082c1a3b7ca

Go to top of page

Requires

Apache Ant
Use on build and tar.gz archive.
Jakarta Velocity
This library use with this document.

Go to top of page

Install

extract dump-x.x.x.tar.gz.

$ gzip -cd dump-x.x.x.tar.gz | tar xvf -

Then you can see dump-x.x.x directory. Use dump.jar on dump-x.x.x/lib directory.

Go to top of page

Usage

You define the class which implements Dumpable interface. And you may obtain Dumper object from DumperFactory class. If you wish dumping object, then you would call Dumper#dump(com.oikaze.tama.dump.Dumpable) method.

Example as follows.

public class SampleDumper implements Dumper{
    public String getName(){ return "sample"; }
    public void dump(OutputStream out) throws IOException{
        out.write("sample data".getBytes());
    }
}
SampleDumpable sample = new SampleDumpable();
Dumper dumper = DumperFactory.getInstance().getDumper("hoge");
dumper.dump(sample);
dumper.close();

Above sample output data("sample data") to "hoge/sample" file. By the way, following sample output data to "hoge.zip" file with zip format. zip file entry is "sample".

SampleDumpable sample = new SampleDumpable();
Dumper dumper = DumperFactory.getInstance().getDumper("hoge.zip");
dumper.dump(sample);

And, following sample output data to memory. Thus, you can obtain byte array from `getByteArray` method.

SampleDumpable sample = new SampleDumpable();
Dumper dumper = DumperFactory.getInstance().getDumper("<memory>");
dumper.dump(sample);
byte[] data = ((MemoryDumper)dumper).getByteArray();
dumper.close();

Go to top of page

Todo

High

Medium

Low

Create Filter

For example, you output with FileDumper, it compress with gzip format.

Go to top of page