directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dran...@apache.org
Subject [2/2] directory-kerberos git commit: added some java doc
Date Sun, 01 Feb 2015 01:11:39 GMT
added some java doc


Project: http://git-wip-us.apache.org/repos/asf/directory-kerberos/repo
Commit: http://git-wip-us.apache.org/repos/asf/directory-kerberos/commit/b44c8979
Tree: http://git-wip-us.apache.org/repos/asf/directory-kerberos/tree/b44c8979
Diff: http://git-wip-us.apache.org/repos/asf/directory-kerberos/diff/b44c8979

Branch: refs/heads/javadoc
Commit: b44c8979ea3daf5cba132a7fffdb5184a068bb8d
Parents: b5da34b
Author: Drankye <drankye@gmail.com>
Authored: Fri Jan 30 11:34:16 2015 +0800
Committer: Drankye <drankye@gmail.com>
Committed: Fri Jan 30 11:34:16 2015 +0800

----------------------------------------------------------------------
 .../java/org/apache/kerby/asn1/Asn1Factory.java | 13 ++++++++++
 .../org/apache/kerby/asn1/Asn1InputBuffer.java  | 27 +++++++++++++++++++-
 2 files changed, 39 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/b44c8979/kerby-asn1/src/main/java/org/apache/kerby/asn1/Asn1Factory.java
----------------------------------------------------------------------
diff --git a/kerby-asn1/src/main/java/org/apache/kerby/asn1/Asn1Factory.java b/kerby-asn1/src/main/java/org/apache/kerby/asn1/Asn1Factory.java
index 2762476..ea4eca8 100644
--- a/kerby-asn1/src/main/java/org/apache/kerby/asn1/Asn1Factory.java
+++ b/kerby-asn1/src/main/java/org/apache/kerby/asn1/Asn1Factory.java
@@ -23,8 +23,16 @@ import org.apache.kerby.asn1.type.Asn1Collection;
 import org.apache.kerby.asn1.type.Asn1Simple;
 import org.apache.kerby.asn1.type.Asn1Type;
 
+/**
+ * ASN1 type factory
+ */
 public class Asn1Factory {
 
+    /**
+     * Create an ASN1 type with specified tag number
+     * @param tagNo
+     * @return ASN1 type
+     */
     public static Asn1Type create(int tagNo) {
         UniversalTag tagNoEnum = UniversalTag.fromValue(tagNo);
         if (tagNoEnum != UniversalTag.UNKNOWN) {
@@ -33,6 +41,11 @@ public class Asn1Factory {
         throw new IllegalArgumentException("Unexpected tag " + tagNo);
     }
 
+    /**
+     * Create an ASN1 type with specified tag
+     * @param tagNo
+     * @return ASN1 type
+     */
     public static Asn1Type create(UniversalTag tagNo) {
         if (Asn1Simple.isSimple(tagNo)) {
             return Asn1Simple.createSimple(tagNo);

http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/b44c8979/kerby-asn1/src/main/java/org/apache/kerby/asn1/Asn1InputBuffer.java
----------------------------------------------------------------------
diff --git a/kerby-asn1/src/main/java/org/apache/kerby/asn1/Asn1InputBuffer.java b/kerby-asn1/src/main/java/org/apache/kerby/asn1/Asn1InputBuffer.java
index 934b0c1..985bd7e 100644
--- a/kerby-asn1/src/main/java/org/apache/kerby/asn1/Asn1InputBuffer.java
+++ b/kerby-asn1/src/main/java/org/apache/kerby/asn1/Asn1InputBuffer.java
@@ -27,23 +27,43 @@ import java.io.IOException;
 import java.nio.ByteBuffer;
 
 /**
- * Asn1 decoder
+ * Asn1 decoder. Given an input stream, it validates and parses
+ * according to ASN1 spec, and the resultant object can be read
+ * and read until exhausted.
  */
 public class Asn1InputBuffer {
     private final LimitedByteBuffer limitedBuffer;
 
+    /**
+     * Constructor with bytes.
+     * @param bytes
+     */
     public Asn1InputBuffer(byte[] bytes) {
         this(new LimitedByteBuffer(bytes));
     }
 
+    /**
+     * Constructor with a ByteBuffer.
+     * @param byteBuffer
+     */
     public Asn1InputBuffer(ByteBuffer byteBuffer) {
         this(new LimitedByteBuffer(byteBuffer));
     }
 
+    /**
+     * Constructor with LimitedByteBuffer.
+     * @param limitedByteBuffer
+     */
     public Asn1InputBuffer(LimitedByteBuffer limitedByteBuffer) {
         this.limitedBuffer = limitedByteBuffer;
     }
 
+    /**
+     * Parse and read ASN1 object from the stream. If it's already
+     * exhausted then null will be returned to indicate the end.
+     * @return an ASN1 object if available otherwise null
+     * @throws IOException
+     */
     public Asn1Type read() throws IOException {
         if (! limitedBuffer.available()) {
             return null;
@@ -60,6 +80,11 @@ public class Asn1InputBuffer {
         return one;
     }
 
+    /**
+     *
+     * @param bytes
+     * @throws IOException
+     */
     public void readBytes(byte[] bytes) throws IOException {
         limitedBuffer.readBytes(bytes);
     }


Mime
View raw message