| 1 32 package net.sf.retrotranslator.runtime.java.io; 33 34 import java.io.*; 35 36 39 public class _Flushable { 40 41 public static boolean executeInstanceOfInstruction(Object object) { 42 return object instanceof OutputStream || 43 object instanceof Writer || 44 object instanceof Flushable_; 45 } 46 47 public static Object executeCheckCastInstruction(Object object) { 48 if (object instanceof OutputStream) { 49 return (OutputStream) object; 50 } 51 if (object instanceof Writer) { 52 return (Writer) object; 53 } 54 return (Flushable_) object; 55 } 56 57 public static void flush(Object object) throws IOException { 58 if (object instanceof OutputStream) { 59 ((OutputStream) object).flush(); 60 } else if (object instanceof Writer) { 61 ((Writer) object).flush(); 62 } else { 63 ((Flushable_) object).flush(); 64 } 65 } 66 67 } 68 | Popular Tags |