samples/delegatingwriter/test/org/apidesign/delegatingwriter/CryptoWriter.java
changeset 210 acf2c31e22d4
parent 209 1c999569643b
child 232 e8d817c1bdc4
     1.1 --- a/samples/delegatingwriter/test/org/apidesign/delegatingwriter/CryptoWriter.java	Sat Jun 14 10:04:51 2008 +0200
     1.2 +++ b/samples/delegatingwriter/test/org/apidesign/delegatingwriter/CryptoWriter.java	Sat Jun 14 10:04:53 2008 +0200
     1.3 @@ -34,26 +34,26 @@
     1.4      public void write(char[] buf, int off, int len) throws IOException {
     1.5          char[] arr = new char[len];
     1.6          for (int i = 0; i < len; i++) {
     1.7 -            arr[i] = convertChar(buf[off + i]);
     1.8 +            arr[i] = encryptChar(buf[off + i]);
     1.9          }
    1.10          super.write(arr, 0, len);
    1.11      }
    1.12  
    1.13      @Override
    1.14      public void write(int c) throws IOException {
    1.15 -        super.write(convertChar(c));
    1.16 +        super.write(encryptChar(c));
    1.17      }
    1.18  
    1.19      @Override
    1.20      public void write(String str, int off, int len) throws IOException {
    1.21          StringBuffer sb = new StringBuffer();
    1.22          for (int i = 0; i < len; i++) {
    1.23 -            sb.append(convertChar(str.charAt(off + i)));
    1.24 +            sb.append(encryptChar(str.charAt(off + i)));
    1.25          }
    1.26          super.write(sb.toString(), 0, len);
    1.27      }
    1.28  
    1.29 -    private char convertChar(int c) {
    1.30 +    private char encryptChar(int c) {
    1.31          if (c == 'Z') {
    1.32              return 'A';
    1.33          }