Return-Path: Delivered-To: apmail-directory-commits-archive@www.apache.org Received: (qmail 82651 invoked from network); 9 Sep 2005 19:22:13 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 9 Sep 2005 19:22:13 -0000 Received: (qmail 27346 invoked by uid 500); 9 Sep 2005 19:22:12 -0000 Delivered-To: apmail-directory-commits-archive@directory.apache.org Received: (qmail 27296 invoked by uid 500); 9 Sep 2005 19:22:12 -0000 Mailing-List: contact commits-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@directory.apache.org Delivered-To: mailing list commits@directory.apache.org Received: (qmail 27283 invoked by uid 99); 9 Sep 2005 19:22:12 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 09 Sep 2005 12:22:12 -0700 X-ASF-Spam-Status: No, hits=-9.8 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.29) with SMTP; Fri, 09 Sep 2005 12:22:24 -0700 Received: (qmail 82648 invoked by uid 65534); 9 Sep 2005 19:22:11 -0000 Message-ID: <20050909192211.82647.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r279849 - /directory/asn1/branches/asn1-new-ber/der/src/java/org/apache/asn1/der/DERTaggedObject.java Date: Fri, 09 Sep 2005 19:22:11 -0000 To: commits@directory.apache.org From: elecharny@apache.org X-Mailer: svnmailer-1.0.5 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: elecharny Date: Fri Sep 9 12:22:07 2005 New Revision: 279849 URL: http://svn.apache.org/viewcvs?rev=279849&view=rev Log: Backport from head Modified: directory/asn1/branches/asn1-new-ber/der/src/java/org/apache/asn1/der/DERTaggedObject.java Modified: directory/asn1/branches/asn1-new-ber/der/src/java/org/apache/asn1/der/DERTaggedObject.java URL: http://svn.apache.org/viewcvs/directory/asn1/branches/asn1-new-ber/der/src/java/org/apache/asn1/der/DERTaggedObject.java?rev=279849&r1=279848&r2=279849&view=diff ============================================================================== --- directory/asn1/branches/asn1-new-ber/der/src/java/org/apache/asn1/der/DERTaggedObject.java (original) +++ directory/asn1/branches/asn1-new-ber/der/src/java/org/apache/asn1/der/DERTaggedObject.java Fri Sep 9 12:22:07 2005 @@ -26,10 +26,20 @@ public class DERTaggedObject implements DEREncodable { protected int tag; - protected boolean empty = false; + protected boolean empty = false; protected boolean explicit = true; - protected DEREncodable obj = null; - + protected DEREncodable obj; + private byte[] bytes; + + /** + * create an implicitly tagged object that contains a zero + * length sequence. + */ + public DERTaggedObject( int tag ) + { + this( false, tag, new DERSequence() ); + } + /** * @param tag the tag number for this object. * @param obj the tagged object. @@ -43,7 +53,7 @@ /** * @param explicit true if an explicitly tagged object. - * @param tagNo the tag number for this object. + * @param tag the tag number for this object. * @param obj the tagged object. */ public DERTaggedObject( boolean explicit, int tag, DEREncodable obj ) @@ -52,21 +62,25 @@ this.tag = tag; this.obj = obj; } - - /** - * create an implicitly tagged object that contains a zero - * length sequence. - */ - public DERTaggedObject( int tag ) + + public DERTaggedObject( boolean explicit, int tag, DEREncodable obj, byte[] bytes ) { - this( false, tag, new DERSequence() ); + this.explicit = explicit; + this.tag = tag; + this.obj = obj; + this.bytes = bytes; } - + + public byte[] getOctets() + { + return bytes; + } + public int getTagNo() { return tag; } - + /** * return whatever was following the tag. *

@@ -84,8 +98,7 @@ return null; } - public void encode( ASN1OutputStream out ) - throws IOException + public void encode( ASN1OutputStream out ) throws IOException { if ( !empty ) { @@ -106,11 +119,11 @@ // need to mark constructed types if ( ( bytes[ 0 ] & DERObject.CONSTRUCTED ) != 0 ) { - bytes[ 0 ] = (byte)( DERObject.CONSTRUCTED | DERObject.TAGGED | tag ); + bytes[ 0 ] = (byte) ( DERObject.CONSTRUCTED | DERObject.TAGGED | tag ); } else { - bytes[ 0 ] = (byte)( DERObject.TAGGED | tag ); + bytes[ 0 ] = (byte) ( DERObject.TAGGED | tag ); } out.write( bytes ); @@ -122,4 +135,3 @@ } } } -