(int i)
| 52 | return b; |
| 53 | } |
| 54 | public static byte fromInt(int i) { |
| 55 | if(i > 256) { |
| 56 | throw new IllegalArgumentException("Number " + i + " too big"); |
| 57 | } |
| 58 | if(i > 127) { |
| 59 | return (byte)(i-256); |
| 60 | } |
| 61 | return (byte)i; |
| 62 | } |
| 63 | |
| 64 | |
| 65 | public static int readOrEOF(InputStream stream) throws IOException { |