/[classpath]/inetlib/source/gnu/inet/util/SaslOutputStream.java
ViewVC logotype

Diff of /inetlib/source/gnu/inet/util/SaslOutputStream.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.4 by dog, Thu Oct 21 15:21:55 2004 UTC revision 1.5 by dog, Thu Nov 25 22:15:05 2004 UTC
# Line 1  Line 1 
1  /*  /*
2   * $Id$   * SaslOutputStream.java
3   * Copyright (C) 2002 The Free Software Foundation   * Copyright (C) 2002 The Free Software Foundation
4   *   *
5   * This file is part of GNU inetlib, a library.   * This file is part of GNU inetlib, a library.
# Line 49  import javax.security.sasl.SaslClient; Line 49  import javax.security.sasl.SaslClient;
49   * client.   * client.
50   *   *
51   * @author <a href="mailto:dog@gnu.org">Chris Burdess</a>   * @author <a href="mailto:dog@gnu.org">Chris Burdess</a>
  * @version $Revision$ $Date$  
52   */   */
53  public class SaslOutputStream extends FilterOutputStream  public class SaslOutputStream
54      extends FilterOutputStream
55  {  {
56    
57    /*    /*
# Line 64  public class SaslOutputStream extends Fi Line 64  public class SaslOutputStream extends Fi
64     * @param sasl the SASL client     * @param sasl the SASL client
65     * @param out the target output stream     * @param out the target output stream
66     */     */
67    public SaslOutputStream (SaslClient sasl, OutputStream out)    public SaslOutputStream(SaslClient sasl, OutputStream out)
68      {    {
69        super (out);      super(out);
70        this.sasl = sasl;      this.sasl = sasl;
71      }    }
72    
73    /**    /**
74     * Character write.     * Character write.
75     */     */
76    public void write (int c) throws IOException    public void write(int c)
77      {      throws IOException
78        byte[] bytes = new byte[1];    {
79        bytes[0] = (byte) c;      byte[] bytes = new byte[1];
80        write (bytes, 0, 1);      bytes[0] = (byte) c;
81      }      write(bytes, 0, 1);
82      }
83    public void write (byte[] bytes) throws IOException  
84      {    public void write(byte[] bytes)
85        write (bytes, 0, bytes.length);      throws IOException
86      }    {
87        write(bytes, 0, bytes.length);
88      }
89      
90    /**    /**
91     * Block write.     * Block write.
92     */     */
93    public void write (byte[] bytes, int off, int len) throws IOException    public void write(byte[] bytes, int off, int len)
94      {      throws IOException
95        byte[] wrapped = sasl.wrap (bytes, off, len);    {
96        super.write (wrapped, 0, wrapped.length);      byte[] wrapped = sasl.wrap(bytes, off, len);
97      }      super.write(wrapped, 0, wrapped.length);
98      }
99      
100  }  }
101    

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26