samples/delegatingwriter/test/org/apidesign/delegatingwriter/CryptoWriter.java
changeset 154 0fd5e9c500b9
parent 153 b5cbb797ec0a
child 180 131332825eab
     1.1 --- a/samples/delegatingwriter/test/org/apidesign/delegatingwriter/CryptoWriter.java	Sat Jun 14 09:58:08 2008 +0200
     1.2 +++ b/samples/delegatingwriter/test/org/apidesign/delegatingwriter/CryptoWriter.java	Sat Jun 14 09:58:11 2008 +0200
     1.3 @@ -13,7 +13,9 @@
     1.4      public CryptoWriter(Writer out) {
     1.5          super(out);
     1.6      }
     1.7 -    public CryptoWriter(Writer out, AltBufferedWriter.Behaviour behaviour) {
     1.8 +    public CryptoWriter(
     1.9 +        Writer out, AltBufferedWriter.Behaviour behaviour
    1.10 +    ) {
    1.11          super(out, behaviour);
    1.12      }
    1.13  /* The above code is here to let us simulate different behaviours of the append
    1.14 @@ -24,15 +26,15 @@
    1.15          super(out);
    1.16      }
    1.17      
    1.18 -    /* We need to override all known methods of BufferedWriter and do conversion
    1.19 -    * of the argument char, string or char array.
    1.20 +    /* We need to override all known methods of BufferedWriter 
    1.21 +    * and do conversion of the argument char, string or char array.
    1.22      */
    1.23      
    1.24      @Override
    1.25 -    public void write(char[] cbuf, int off, int len) throws IOException {
    1.26 +    public void write(char[] buf, int off, int len) throws IOException {
    1.27          char[] arr = new char[len];
    1.28          for (int i = 0; i < len; i++) {
    1.29 -            arr[i] = convertChar(cbuf[off + i]);
    1.30 +            arr[i] = convertChar(buf[off + i]);
    1.31          }
    1.32          super.write(arr, 0, len);
    1.33      }
    1.34 @@ -60,7 +62,7 @@
    1.35          }
    1.36          return (char)(c + 1);
    1.37      }
    1.38 -// END: writer.CryptoWriter
    1.39 +// FINISH: writer.CryptoWriter
    1.40  
    1.41      /* delegates to write(cbuf, 0, cbuf.length)
    1.42      public void write(char[] cbuf) throws IOException {