From 3acecfb5af679b2c9ac7ce9572f3786799bb8054 Mon Sep 17 00:00:00 2001 From: "Taro L. Saito" Date: Thu, 22 Sep 2011 16:14:53 +0900 Subject: [PATCH] Fixes issue 27. Add package-info.java and javadoc stylesheet --- .../java/org/xerial/snappy/package-info.java | 44 +++++++++++++++++++ stylesheet.css | 34 ++++++++++++++ 2 files changed, 78 insertions(+) create mode 100755 src/main/java/org/xerial/snappy/package-info.java create mode 100755 stylesheet.css diff --git a/src/main/java/org/xerial/snappy/package-info.java b/src/main/java/org/xerial/snappy/package-info.java new file mode 100755 index 0000000..98f4d95 --- /dev/null +++ b/src/main/java/org/xerial/snappy/package-info.java @@ -0,0 +1,44 @@ +/*-------------------------------------------------------------------------- + * Copyright 2011 Taro L. Saito + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *--------------------------------------------------------------------------*/ + +/** + * Snappy API for compressing/decompressing data. + * + * Usage + * First, import {@link org.xerial.snappy.Snappy} in your Java code: + * + *
+ * import org.xerial.snappy.Snappy;
+ * 
+ *
+ * Then use {@link org.xerial.snappy.Snappy#compress(byte[])} and {@link org.xerial.snappy.Snappy#uncompress(byte[])}: + * + *
+ * String input = "Hello snappy-java! Snappy-java is a JNI-based wrapper of Snappy, a fast compresser/decompresser.";
+ * byte[] compressed = Snappy.compress(input.getBytes("UTF-8"));
+ * byte[] uncompressed = Snappy.uncompress(compressed);
+ * String result = new String(uncompressed, "UTF-8");
+ * System.out.println(result);
+ * 
+ *
+ * + *

In addition, high-level methods (Snappy.compress(String), Snappy.compress(float[] ..) etc. ) and low-level ones (e.g. Snappy.rawCompress(.. ), Snappy.rawUncompress(..), etc.), which minimize memory copies, can be used.

+ * + *

Stream-based API

+ * Stream-based compressor/decompressor SnappyOutputStream, SnappyInputStream are also available for reading/writing large data sets. + */ +package org.xerial.snappy; + diff --git a/stylesheet.css b/stylesheet.css new file mode 100755 index 0000000..5161451 --- /dev/null +++ b/stylesheet.css @@ -0,0 +1,34 @@ +/* Javadoc style sheet */ + +/* Define colors, fonts and other style attributes here to override the defaults */ + +/* Page background color */ +body { background-color: #FFFFFF; color:#000000; font-family: Arial, sans-serif; } + +/* Headings */ +h1 { font-size: 145% } + +a:link { color: #006699; } +a:hover { color: #6699CC; } +a:active { color: #6699CC; } +a:visited { color: #669999; } + +/* Table colors */ +.TableHeadingColor { background: #3399CC; color:#FFFFFF } /* Dark mauve */ +.TableSubHeadingColor { background: #EEEEFF; color:#000000 } /* Light mauve */ +.TableRowColor { background: #FFFFFF; color:#000000 } /* White */ + +/* Font used in left-hand frame lists */ +.FrameTitleFont { font-size: 100%; font-family: Arial, sans-serif; color:#000000 } +.FrameHeadingFont { font-size: 90%; font-family: Arial, sans-serif; color:#000000 } +.FrameItemFont { font-size: 90%; font-family: Arial, sans-serif; color:#000000 } + +/* Navigation bar fonts and colors */ +.NavBarCell1 { background-color:#EEEEFF; color:#000000} /* Light mauve */ +.NavBarCell1Rev { background-color:#00008B; color:#FFFFFF} /* Dark Blue */ +.NavBarFont1 { font-family: Arial, sans-serif; color:#000000;color:#000000;} +.NavBarFont1Rev { font-family: Arial, sans-serif; color:#FFFFFF;color:#FFFFFF;} + +.NavBarCell2 { font-family: Arial, sans-serif; background-color:#FFFFFF; color:#000000} +.NavBarCell3 { font-family: Arial, sans-serif; background-color:#FFFFFF; color:#000000} +