Advertisement
Guest User

Untitled

a guest
Jan 23rd, 2020
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement