directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From trus...@apache.org
Subject svn commit: r161723 - in directory/asn1/trunk/codec: ./ bin/ src/java/org/apache/asn1/codec/binary/ src/java/org/apache/asn1/codec/mina/ src/java/org/apache/asn1/codec/stateful/ src/java/org/apache/asn1/codec/stateful/examples/ src/test/org/apache/asn1/codec/stateful/ src/test/org/apache/asn1/codec/stateful/examples/
Date Mon, 18 Apr 2005 04:10:16 GMT
Author: trustin
Date: Sun Apr 17 21:10:12 2005
New Revision: 161723

URL: http://svn.apache.org/viewcvs?view=rev&rev=161723
Log:
* Added MINA codec adapters
* Optimized imports
* Fixed JavaDoc errors

Added:
    directory/asn1/trunk/codec/bin/
    directory/asn1/trunk/codec/src/java/org/apache/asn1/codec/mina/
    directory/asn1/trunk/codec/src/java/org/apache/asn1/codec/mina/Asn1CodecDecoder.java 
 (with props)
    directory/asn1/trunk/codec/src/java/org/apache/asn1/codec/mina/Asn1CodecEncoder.java 
 (with props)
Modified:
    directory/asn1/trunk/codec/project.xml
    directory/asn1/trunk/codec/src/java/org/apache/asn1/codec/binary/BinaryCodec.java
    directory/asn1/trunk/codec/src/java/org/apache/asn1/codec/binary/Hex.java
    directory/asn1/trunk/codec/src/java/org/apache/asn1/codec/stateful/CallbackHistory.java
    directory/asn1/trunk/codec/src/java/org/apache/asn1/codec/stateful/DecoderMonitor.java
    directory/asn1/trunk/codec/src/java/org/apache/asn1/codec/stateful/DecoderMonitorAdapter.java
    directory/asn1/trunk/codec/src/java/org/apache/asn1/codec/stateful/DecoderStack.java
    directory/asn1/trunk/codec/src/java/org/apache/asn1/codec/stateful/EncoderMonitor.java
    directory/asn1/trunk/codec/src/java/org/apache/asn1/codec/stateful/EncoderMonitorAdapter.java
    directory/asn1/trunk/codec/src/java/org/apache/asn1/codec/stateful/StatefulDecoder.java
    directory/asn1/trunk/codec/src/java/org/apache/asn1/codec/stateful/StatefulEncoder.java
    directory/asn1/trunk/codec/src/java/org/apache/asn1/codec/stateful/examples/HexDecoder.java
    directory/asn1/trunk/codec/src/java/org/apache/asn1/codec/stateful/examples/HexEncoder.java
    directory/asn1/trunk/codec/src/test/org/apache/asn1/codec/stateful/DecoderStackTest.java
    directory/asn1/trunk/codec/src/test/org/apache/asn1/codec/stateful/examples/HexDecoderTest.java
    directory/asn1/trunk/codec/src/test/org/apache/asn1/codec/stateful/examples/HexEncoderTest.java

Modified: directory/asn1/trunk/codec/project.xml
URL: http://svn.apache.org/viewcvs/directory/asn1/trunk/codec/project.xml?view=diff&r1=161722&r2=161723
==============================================================================
--- directory/asn1/trunk/codec/project.xml (original)
+++ directory/asn1/trunk/codec/project.xml Sun Apr 17 21:10:12 2005
@@ -22,6 +22,12 @@
       
   <dependencies>
     <dependency>
+      <groupId>directory-network</groupId>
+      <artifactId>mina</artifactId>
+      <version>0.7-SNAPSHOT</version>
+      <url>http://directory.apache.org/subprojects/network/mina/</url>
+    </dependency>
+    <dependency>
       <groupId>junit</groupId>
       <artifactId>junit</artifactId>
       <version>3.8.1</version>

Modified: directory/asn1/trunk/codec/src/java/org/apache/asn1/codec/binary/BinaryCodec.java
URL: http://svn.apache.org/viewcvs/directory/asn1/trunk/codec/src/java/org/apache/asn1/codec/binary/BinaryCodec.java?view=diff&r1=161722&r2=161723
==============================================================================
--- directory/asn1/trunk/codec/src/java/org/apache/asn1/codec/binary/BinaryCodec.java (original)
+++ directory/asn1/trunk/codec/src/java/org/apache/asn1/codec/binary/BinaryCodec.java Sun
Apr 17 21:10:12 2005
@@ -16,10 +16,10 @@
 
 package org.apache.asn1.codec.binary;
 
-import org.apache.asn1.codec.EncoderException;
 import org.apache.asn1.codec.BinaryDecoder;
 import org.apache.asn1.codec.BinaryEncoder;
-import org.apache.asn1.codec.*;
+import org.apache.asn1.codec.DecoderException;
+import org.apache.asn1.codec.EncoderException;
 
 /**
  * Translates between byte arrays and strings of "0"s and "1"s.

Modified: directory/asn1/trunk/codec/src/java/org/apache/asn1/codec/binary/Hex.java
URL: http://svn.apache.org/viewcvs/directory/asn1/trunk/codec/src/java/org/apache/asn1/codec/binary/Hex.java?view=diff&r1=161722&r2=161723
==============================================================================
--- directory/asn1/trunk/codec/src/java/org/apache/asn1/codec/binary/Hex.java (original)
+++ directory/asn1/trunk/codec/src/java/org/apache/asn1/codec/binary/Hex.java Sun Apr 17 21:10:12
2005
@@ -16,11 +16,10 @@
 
 package org.apache.asn1.codec.binary;
 
-import org.apache.asn1.codec.DecoderException;
-import org.apache.asn1.codec.EncoderException;
 import org.apache.asn1.codec.BinaryDecoder;
 import org.apache.asn1.codec.BinaryEncoder;
-import org.apache.asn1.codec.*;
+import org.apache.asn1.codec.DecoderException;
+import org.apache.asn1.codec.EncoderException;
 
 /**
  * Hex encoder and decoder.

Added: directory/asn1/trunk/codec/src/java/org/apache/asn1/codec/mina/Asn1CodecDecoder.java
URL: http://svn.apache.org/viewcvs/directory/asn1/trunk/codec/src/java/org/apache/asn1/codec/mina/Asn1CodecDecoder.java?view=auto&rev=161723
==============================================================================
--- directory/asn1/trunk/codec/src/java/org/apache/asn1/codec/mina/Asn1CodecDecoder.java (added)
+++ directory/asn1/trunk/codec/src/java/org/apache/asn1/codec/mina/Asn1CodecDecoder.java Sun
Apr 17 21:10:12 2005
@@ -0,0 +1,58 @@
+/*
+ * @(#) $Id$
+ */
+package org.apache.asn1.codec.mina;
+
+import org.apache.asn1.codec.DecoderException;
+import org.apache.asn1.codec.stateful.DecoderCallback;
+import org.apache.asn1.codec.stateful.StatefulDecoder;
+import org.apache.mina.common.ByteBuffer;
+import org.apache.mina.protocol.ProtocolDecoder;
+import org.apache.mina.protocol.ProtocolDecoderOutput;
+import org.apache.mina.protocol.ProtocolSession;
+import org.apache.mina.protocol.ProtocolViolationException;
+
+/**
+ * Adapts {@link StatefulDecoder} to MINA <tt>ProtocolDecoder</tt>
+ * 
+ * @author Trustin Lee (trustin@apache.org)
+ * @version $Rev$, $Date$, 
+ */
+public class Asn1CodecDecoder implements ProtocolDecoder
+{
+
+    private final StatefulDecoder decoder;
+
+    private final DecoderCallbackImpl callback = new DecoderCallbackImpl();
+
+    public Asn1CodecDecoder( StatefulDecoder decoder )
+    {
+        decoder.setCallback( callback );
+        this.decoder = decoder;
+    }
+
+    public void decode( ProtocolSession session, ByteBuffer in,
+                       ProtocolDecoderOutput out )
+            throws ProtocolViolationException
+    {
+        callback.decOut = out;
+        try
+        {
+            decoder.decode( in.buf() );
+        }
+        catch( DecoderException e )
+        {
+            throw new ProtocolViolationException( "Failed to decode.", e );
+        }
+    }
+
+    private class DecoderCallbackImpl implements DecoderCallback
+    {
+        private ProtocolDecoderOutput decOut;
+
+        public void decodeOccurred( StatefulDecoder decoder, Object decoded )
+        {
+            decOut.write( decoded );
+        }
+    }
+}
\ No newline at end of file

Propchange: directory/asn1/trunk/codec/src/java/org/apache/asn1/codec/mina/Asn1CodecDecoder.java
------------------------------------------------------------------------------
    svn:keywords = HeadURL Id LastChangedBy LastChangedDate LastChangedRevision

Added: directory/asn1/trunk/codec/src/java/org/apache/asn1/codec/mina/Asn1CodecEncoder.java
URL: http://svn.apache.org/viewcvs/directory/asn1/trunk/codec/src/java/org/apache/asn1/codec/mina/Asn1CodecEncoder.java?view=auto&rev=161723
==============================================================================
--- directory/asn1/trunk/codec/src/java/org/apache/asn1/codec/mina/Asn1CodecEncoder.java (added)
+++ directory/asn1/trunk/codec/src/java/org/apache/asn1/codec/mina/Asn1CodecEncoder.java Sun
Apr 17 21:10:12 2005
@@ -0,0 +1,111 @@
+/*
+ * @(#) $Id$
+ */
+package org.apache.asn1.codec.mina;
+
+import java.util.Collection;
+import java.util.Enumeration;
+import java.util.Iterator;
+
+import org.apache.asn1.codec.EncoderException;
+import org.apache.asn1.codec.stateful.EncoderCallback;
+import org.apache.asn1.codec.stateful.StatefulEncoder;
+import org.apache.mina.common.ByteBuffer;
+import org.apache.mina.protocol.ProtocolEncoder;
+import org.apache.mina.protocol.ProtocolEncoderOutput;
+import org.apache.mina.protocol.ProtocolSession;
+import org.apache.mina.protocol.ProtocolViolationException;
+
+/**
+ * Adapts {@link StatefulEncoder} to MINA <tt>ProtocolEncoder</tt>
+ * 
+ * @author Trustin Lee (trustin@apache.org)
+ * @version $Rev$, $Date$, 
+ */
+public class Asn1CodecEncoder implements ProtocolEncoder
+{
+    private final StatefulEncoder encoder;
+
+    private final EncoderCallbackImpl callback = new EncoderCallbackImpl();
+
+    public Asn1CodecEncoder( StatefulEncoder encoder )
+    {
+        encoder.setCallback( callback );
+        this.encoder = encoder;
+    }
+
+    public void encode( ProtocolSession session, Object message,
+                       ProtocolEncoderOutput out )
+            throws ProtocolViolationException
+    {
+        callback.encOut = out;
+        try
+        {
+            encoder.encode( message );
+        }
+        catch( EncoderException e )
+        {
+            throw new ProtocolViolationException( "Encoding failed.", e );
+        }
+    }
+
+    private class EncoderCallbackImpl implements EncoderCallback
+    {
+        private ProtocolEncoderOutput encOut;
+
+        public void encodeOccurred( StatefulEncoder codec, Object encoded )
+        {
+            if( encoded instanceof java.nio.ByteBuffer )
+            {
+                java.nio.ByteBuffer buf = ( java.nio.ByteBuffer ) encoded;
+                encOut.write( ByteBuffer.wrap( buf ) );
+            }
+            else if( encoded instanceof Object[] )
+            {
+                Object[] bufArray = ( Object[] ) encoded;
+                for( int i = 0; i < bufArray.length; i ++ )
+                {
+                    this.encodeOccurred( codec, bufArray[ i ] );
+                }
+
+                encOut.mergeAll();
+            }
+            else if( encoded instanceof Iterator )
+            {
+                Iterator it = ( Iterator ) encoded;
+                while( it.hasNext() )
+                {
+                    this.encodeOccurred( codec, it.next() );
+                }
+                
+                encOut.mergeAll();
+            }
+            else if( encoded instanceof Collection )
+            {
+                Iterator it = ( ( Collection ) encoded ).iterator();
+                while( it.hasNext() )
+                {
+                    this.encodeOccurred( codec, it.next() );
+                }
+                
+                encOut.mergeAll();
+            }
+            else if( encoded instanceof Enumeration )
+            {
+                Enumeration e = ( Enumeration ) encoded;
+                while( e.hasMoreElements() )
+                {
+                    this.encodeOccurred( codec, e.nextElement() );
+                }
+                
+                encOut.mergeAll();
+            }
+            else
+            {
+                throw new IllegalArgumentException(
+                        "Encoded result is not a ByteBuffer: " +
+                        encoded.getClass() );
+            }
+        }
+    }
+}

Propchange: directory/asn1/trunk/codec/src/java/org/apache/asn1/codec/mina/Asn1CodecEncoder.java
------------------------------------------------------------------------------
    svn:keywords = HeadURL Id LastChangedBy LastChangedDate LastChangedRevision

Modified: directory/asn1/trunk/codec/src/java/org/apache/asn1/codec/stateful/CallbackHistory.java
URL: http://svn.apache.org/viewcvs/directory/asn1/trunk/codec/src/java/org/apache/asn1/codec/stateful/CallbackHistory.java?view=diff&r1=161722&r2=161723
==============================================================================
--- directory/asn1/trunk/codec/src/java/org/apache/asn1/codec/stateful/CallbackHistory.java
(original)
+++ directory/asn1/trunk/codec/src/java/org/apache/asn1/codec/stateful/CallbackHistory.java
Sun Apr 17 21:10:12 2005
@@ -17,7 +17,7 @@
 package org.apache.asn1.codec.stateful ;
 
 
-import java.util.LinkedList ;
+import java.util.LinkedList;
 
 
 /**

Modified: directory/asn1/trunk/codec/src/java/org/apache/asn1/codec/stateful/DecoderMonitor.java
URL: http://svn.apache.org/viewcvs/directory/asn1/trunk/codec/src/java/org/apache/asn1/codec/stateful/DecoderMonitor.java?view=diff&r1=161722&r2=161723
==============================================================================
--- directory/asn1/trunk/codec/src/java/org/apache/asn1/codec/stateful/DecoderMonitor.java
(original)
+++ directory/asn1/trunk/codec/src/java/org/apache/asn1/codec/stateful/DecoderMonitor.java
Sun Apr 17 21:10:12 2005
@@ -17,7 +17,6 @@
 package org.apache.asn1.codec.stateful ;
 
 
-import org.apache.asn1.codec.stateful.DecoderCallback;
 
 
 /**

Modified: directory/asn1/trunk/codec/src/java/org/apache/asn1/codec/stateful/DecoderMonitorAdapter.java
URL: http://svn.apache.org/viewcvs/directory/asn1/trunk/codec/src/java/org/apache/asn1/codec/stateful/DecoderMonitorAdapter.java?view=diff&r1=161722&r2=161723
==============================================================================
--- directory/asn1/trunk/codec/src/java/org/apache/asn1/codec/stateful/DecoderMonitorAdapter.java
(original)
+++ directory/asn1/trunk/codec/src/java/org/apache/asn1/codec/stateful/DecoderMonitorAdapter.java
Sun Apr 17 21:10:12 2005
@@ -17,8 +17,6 @@
 package org.apache.asn1.codec.stateful ;
 
 
-import org.apache.asn1.codec.stateful.DecoderCallback;
-import org.apache.asn1.codec.stateful.DecoderMonitor;
 
 
 /**

Modified: directory/asn1/trunk/codec/src/java/org/apache/asn1/codec/stateful/DecoderStack.java
URL: http://svn.apache.org/viewcvs/directory/asn1/trunk/codec/src/java/org/apache/asn1/codec/stateful/DecoderStack.java?view=diff&r1=161722&r2=161723
==============================================================================
--- directory/asn1/trunk/codec/src/java/org/apache/asn1/codec/stateful/DecoderStack.java (original)
+++ directory/asn1/trunk/codec/src/java/org/apache/asn1/codec/stateful/DecoderStack.java Sun
Apr 17 21:10:12 2005
@@ -17,11 +17,8 @@
 package org.apache.asn1.codec.stateful ;
 
 
-import java.util.Stack ;
+import java.util.Stack;
 
-import org.apache.asn1.codec.DecoderException ;
-import org.apache.asn1.codec.stateful.AbstractStatefulDecoder;
-import org.apache.asn1.codec.stateful.DecoderCallback;
 import org.apache.asn1.codec.DecoderException;
 
 
@@ -184,7 +181,7 @@
         
         
         /**
-         * Calls the {@link decode(Object)} method of the sink if the decoder 
+         * Calls the {@link #decode(Object)} method of the sink if the decoder 
          * argument is the source.  Any failures that occur during the sink's 
          * decode operation are reported to the monitor first then rethrown as
          * runtime exceptions with the root cause set to the faulting exception.

Modified: directory/asn1/trunk/codec/src/java/org/apache/asn1/codec/stateful/EncoderMonitor.java
URL: http://svn.apache.org/viewcvs/directory/asn1/trunk/codec/src/java/org/apache/asn1/codec/stateful/EncoderMonitor.java?view=diff&r1=161722&r2=161723
==============================================================================
--- directory/asn1/trunk/codec/src/java/org/apache/asn1/codec/stateful/EncoderMonitor.java
(original)
+++ directory/asn1/trunk/codec/src/java/org/apache/asn1/codec/stateful/EncoderMonitor.java
Sun Apr 17 21:10:12 2005
@@ -17,7 +17,6 @@
 package org.apache.asn1.codec.stateful;
 
 
-import org.apache.asn1.codec.stateful.EncoderCallback;
 
 
 /**

Modified: directory/asn1/trunk/codec/src/java/org/apache/asn1/codec/stateful/EncoderMonitorAdapter.java
URL: http://svn.apache.org/viewcvs/directory/asn1/trunk/codec/src/java/org/apache/asn1/codec/stateful/EncoderMonitorAdapter.java?view=diff&r1=161722&r2=161723
==============================================================================
--- directory/asn1/trunk/codec/src/java/org/apache/asn1/codec/stateful/EncoderMonitorAdapter.java
(original)
+++ directory/asn1/trunk/codec/src/java/org/apache/asn1/codec/stateful/EncoderMonitorAdapter.java
Sun Apr 17 21:10:12 2005
@@ -17,8 +17,6 @@
 package org.apache.asn1.codec.stateful;
 
 
-import org.apache.asn1.codec.stateful.EncoderCallback;
-import org.apache.asn1.codec.stateful.EncoderMonitor;
 
 
 /**

Modified: directory/asn1/trunk/codec/src/java/org/apache/asn1/codec/stateful/StatefulDecoder.java
URL: http://svn.apache.org/viewcvs/directory/asn1/trunk/codec/src/java/org/apache/asn1/codec/stateful/StatefulDecoder.java?view=diff&r1=161722&r2=161723
==============================================================================
--- directory/asn1/trunk/codec/src/java/org/apache/asn1/codec/stateful/StatefulDecoder.java
(original)
+++ directory/asn1/trunk/codec/src/java/org/apache/asn1/codec/stateful/StatefulDecoder.java
Sun Apr 17 21:10:12 2005
@@ -17,9 +17,6 @@
 package org.apache.asn1.codec.stateful ;
 
 
-import org.apache.asn1.codec.DecoderException ;
-import org.apache.asn1.codec.stateful.DecoderCallback;
-import org.apache.asn1.codec.stateful.DecoderMonitor;
 import org.apache.asn1.codec.DecoderException;
 
 

Modified: directory/asn1/trunk/codec/src/java/org/apache/asn1/codec/stateful/StatefulEncoder.java
URL: http://svn.apache.org/viewcvs/directory/asn1/trunk/codec/src/java/org/apache/asn1/codec/stateful/StatefulEncoder.java?view=diff&r1=161722&r2=161723
==============================================================================
--- directory/asn1/trunk/codec/src/java/org/apache/asn1/codec/stateful/StatefulEncoder.java
(original)
+++ directory/asn1/trunk/codec/src/java/org/apache/asn1/codec/stateful/StatefulEncoder.java
Sun Apr 17 21:10:12 2005
@@ -17,9 +17,6 @@
 package org.apache.asn1.codec.stateful ;
 
 
-import org.apache.asn1.codec.EncoderException ;
-import org.apache.asn1.codec.stateful.EncoderCallback;
-import org.apache.asn1.codec.stateful.EncoderMonitor;
 import org.apache.asn1.codec.EncoderException;
 
 

Modified: directory/asn1/trunk/codec/src/java/org/apache/asn1/codec/stateful/examples/HexDecoder.java
URL: http://svn.apache.org/viewcvs/directory/asn1/trunk/codec/src/java/org/apache/asn1/codec/stateful/examples/HexDecoder.java?view=diff&r1=161722&r2=161723
==============================================================================
--- directory/asn1/trunk/codec/src/java/org/apache/asn1/codec/stateful/examples/HexDecoder.java
(original)
+++ directory/asn1/trunk/codec/src/java/org/apache/asn1/codec/stateful/examples/HexDecoder.java
Sun Apr 17 21:10:12 2005
@@ -16,12 +16,10 @@
  */
 package org.apache.asn1.codec.stateful.examples;
 
-import org.apache.asn1.codec.stateful.AbstractStatefulDecoder;
+import java.nio.ByteBuffer;
+
 import org.apache.asn1.codec.DecoderException;
 import org.apache.asn1.codec.stateful.AbstractStatefulDecoder;
-import org.apache.asn1.codec.DecoderException;
-
-import java.nio.ByteBuffer;
 
 /**
  * Document me.

Modified: directory/asn1/trunk/codec/src/java/org/apache/asn1/codec/stateful/examples/HexEncoder.java
URL: http://svn.apache.org/viewcvs/directory/asn1/trunk/codec/src/java/org/apache/asn1/codec/stateful/examples/HexEncoder.java?view=diff&r1=161722&r2=161723
==============================================================================
--- directory/asn1/trunk/codec/src/java/org/apache/asn1/codec/stateful/examples/HexEncoder.java
(original)
+++ directory/asn1/trunk/codec/src/java/org/apache/asn1/codec/stateful/examples/HexEncoder.java
Sun Apr 17 21:10:12 2005
@@ -16,15 +16,13 @@
  */
 package org.apache.asn1.codec.stateful.examples;
 
-import org.apache.asn1.codec.stateful.StatefulEncoder;
-import org.apache.asn1.codec.stateful.EncoderMonitorAdapter;
+import java.nio.ByteBuffer;
+
 import org.apache.asn1.codec.EncoderException;
 import org.apache.asn1.codec.stateful.EncoderCallback;
 import org.apache.asn1.codec.stateful.EncoderMonitor;
-import org.apache.asn1.codec.stateful.*;
-import org.apache.asn1.codec.EncoderException;
-
-import java.nio.ByteBuffer;
+import org.apache.asn1.codec.stateful.EncoderMonitorAdapter;
+import org.apache.asn1.codec.stateful.StatefulEncoder;
 
 
 /**

Modified: directory/asn1/trunk/codec/src/test/org/apache/asn1/codec/stateful/DecoderStackTest.java
URL: http://svn.apache.org/viewcvs/directory/asn1/trunk/codec/src/test/org/apache/asn1/codec/stateful/DecoderStackTest.java?view=diff&r1=161722&r2=161723
==============================================================================
--- directory/asn1/trunk/codec/src/test/org/apache/asn1/codec/stateful/DecoderStackTest.java
(original)
+++ directory/asn1/trunk/codec/src/test/org/apache/asn1/codec/stateful/DecoderStackTest.java
Sun Apr 17 21:10:12 2005
@@ -17,13 +17,9 @@
 package org.apache.asn1.codec.stateful ;
 
 
-import org.apache.asn1.codec.DecoderException ;
-import org.apache.asn1.codec.stateful.AbstractStatefulDecoder;
-import org.apache.asn1.codec.stateful.CallbackHistory;
-import org.apache.asn1.codec.stateful.DecoderStack;
-import org.apache.asn1.codec.DecoderException;
+import junit.framework.TestCase;
 
-import junit.framework.TestCase ;
+import org.apache.asn1.codec.DecoderException;
 
 
 /**

Modified: directory/asn1/trunk/codec/src/test/org/apache/asn1/codec/stateful/examples/HexDecoderTest.java
URL: http://svn.apache.org/viewcvs/directory/asn1/trunk/codec/src/test/org/apache/asn1/codec/stateful/examples/HexDecoderTest.java?view=diff&r1=161722&r2=161723
==============================================================================
--- directory/asn1/trunk/codec/src/test/org/apache/asn1/codec/stateful/examples/HexDecoderTest.java
(original)
+++ directory/asn1/trunk/codec/src/test/org/apache/asn1/codec/stateful/examples/HexDecoderTest.java
Sun Apr 17 21:10:12 2005
@@ -16,18 +16,15 @@
  */
 package org.apache.asn1.codec.stateful.examples;
 
-import junit.framework.TestCase;
-
-import java.util.Random;
 import java.nio.ByteBuffer;
+import java.util.Random;
+
+import junit.framework.TestCase;
 
+import org.apache.asn1.codec.DecoderException;
 import org.apache.asn1.codec.binary.Hex;
 import org.apache.asn1.codec.stateful.DecoderCallback;
 import org.apache.asn1.codec.stateful.StatefulDecoder;
-import org.apache.asn1.codec.stateful.StatefulDecoder;
-import org.apache.asn1.codec.DecoderException;
-import org.apache.asn1.codec.stateful.examples.HexDecoder;
-import org.apache.asn1.codec.binary.Hex;
 
 /**
  * Document me.

Modified: directory/asn1/trunk/codec/src/test/org/apache/asn1/codec/stateful/examples/HexEncoderTest.java
URL: http://svn.apache.org/viewcvs/directory/asn1/trunk/codec/src/test/org/apache/asn1/codec/stateful/examples/HexEncoderTest.java?view=diff&r1=161722&r2=161723
==============================================================================
--- directory/asn1/trunk/codec/src/test/org/apache/asn1/codec/stateful/examples/HexEncoderTest.java
(original)
+++ directory/asn1/trunk/codec/src/test/org/apache/asn1/codec/stateful/examples/HexEncoderTest.java
Sun Apr 17 21:10:12 2005
@@ -16,18 +16,15 @@
  */
 package org.apache.asn1.codec.stateful.examples;
 
+import java.nio.ByteBuffer;
+import java.util.Random;
+
 import junit.framework.TestCase;
+
 import org.apache.asn1.codec.EncoderException;
 import org.apache.asn1.codec.binary.Hex;
 import org.apache.asn1.codec.stateful.EncoderCallback;
 import org.apache.asn1.codec.stateful.StatefulEncoder;
-import org.apache.asn1.codec.stateful.examples.HexEncoder;
-import org.apache.asn1.codec.stateful.EncoderCallback;
-import org.apache.asn1.codec.stateful.StatefulEncoder;
-import org.apache.asn1.codec.EncoderException;
-
-import java.util.Random;
-import java.nio.ByteBuffer;
 
 /**
  * Document me.



Mime
View raw message