package ParallelSecondo; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.Vector; import sj.lang.MyDataInputStream; public class RMDataInputStream extends MyDataInputStream { public RMDataInputStream(InputStream I) { super(I); // TODO Auto-generated constructor stub In = I; } public void close() throws IOException{ In.close(); } public int available() throws IOException{ return In.available(); } public void mark(int readLimit){ In.mark(readLimit); } public boolean markSupported(){ return In.markSupported(); } /* returns the positive value of b */ private int getUnsigned(byte b){ if(b<0) return 256+b; else return b; } /** read a integer from stream */ /** follows little-endian ordering */ public int readInt() throws IOException{ readFullBuffer(IntBuffer); int res = 0; for(int i=3;i>=0;i--){ res = res*256+getUnsigned(IntBuffer[i]); } return res; } /** fills the buffer * if not enough data are available a IOException is thrown */ private void readFullBuffer(byte[] buffer) throws IOException{ int size = buffer.length; int readed = 0; int small; while(readed