Guest User

Untitled

a guest
Jan 23rd, 2020
93
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package Blatt18;
  2.  
  3. import java.io.*;
  4.  
  5. public class ToUpperCaseWriter extends Writer{
  6.  
  7. Writer os;
  8.  
  9. public ToUpperCaseWriter(Writer os){
  10. this.os = os;
  11. }
  12. public void write(char c) throws IOException {
  13. os.write(Character.toUpperCase(c));
  14. }
  15. public void write(char[] cbuf, int off, int len) throws IOException {
  16. for(int i = off; i < off + len; i++)
  17. write(cbuf[i]);
  18. }
  19. public void write(String str, int off, int len) throws IOException
  20. {
  21. for (int i = off; i < off + len; i++)
  22. write(str.charAt(i));
  23. }
  24.  
  25. //alle (relevanten) Methoden von Writer ├╝berschreiben
  26. public void flush() throws IOException
  27. {
  28. os.flush();
  29. }
  30. public void close() throws IOException
  31. {
  32. os.close();
  33. }
  34. }
RAW Paste Data