1 32 package net.sf.retrotranslator.runtime.java.lang; 33 34 import java.io.*; 35 import java.nio.CharBuffer ; 36 import net.sf.retrotranslator.runtime.java.io._Reader; 37 import net.sf.retrotranslator.runtime.java.nio._CharBuffer; 38 39 42 public class _Readable { 43 44 public static boolean executeInstanceOfInstruction(Object object) { 45 return object instanceof Reader || 46 object instanceof CharBuffer || 47 object instanceof Readable_; 48 } 49 50 public static Object executeCheckCastInstruction(Object object) { 51 if (object instanceof Reader) { 52 return (Reader) object; 53 } 54 if (object instanceof CharBuffer ) { 55 return (CharBuffer ) object; 56 } 57 return (Readable_) object; 58 } 59 60 public static int read(Object object, CharBuffer cb) throws IOException { 61 if (object instanceof Reader) { 62 return _Reader.read((Reader) object, cb); 63 } 64 if (object instanceof CharBuffer ) { 65 return _CharBuffer.read((CharBuffer ) object, cb); 66 } 67 return ((Readable_) object).read(cb); 68 } 69 70 } 71 | Popular Tags |