public float readFloat() throws IOException { return Float.intBitsToFloat(readInt()); }
/** Reads the message's contents from an input stream, but skips the buffer and instead returns the * position (offset) at which the buffer starts */ public int readFromSkipPayload(ByteArrayDataInputStream in) throws Exception { // 1. read the leading byte first byte leading=in.readByte(); // 2. the flags flags=in.readShort(); // 3. dest_addr if(Util.isFlagSet(leading, DEST_SET)) dest_addr=Util.readAddress(in); // 4. src_addr if(Util.isFlagSet(leading, SRC_SET)) src_addr=Util.readAddress(in); // 5. headers int len=in.readShort(); headers=createHeaders(len); for(int i=0; i < len; i++) { short id=in.readShort(); Header hdr=readHeader(in).setProtId(id); this.headers[i]=hdr; } // 6. buf if(!Util.isFlagSet(leading, BUF_SET)) return -1; length=in.readInt(); return in.position(); }
public float readFloat() throws IOException { return Float.intBitsToFloat(readInt()); }
/** Reads the message's contents from an input stream, but skips the buffer and instead returns the * position (offset) at which the buffer starts */ public int readFromSkipPayload(ByteArrayDataInputStream in) throws Exception { // 1. read the leading byte first byte leading=in.readByte(); // 2. the flags flags=in.readShort(); // 3. dest_addr if(Util.isFlagSet(leading, DEST_SET)) dest_addr=Util.readAddress(in); // 4. src_addr if(Util.isFlagSet(leading, SRC_SET)) src_addr=Util.readAddress(in); // 5. headers int len=in.readShort(); headers=createHeaders(len); for(int i=0; i < len; i++) { short id=in.readShort(); Header hdr=readHeader(in).setProtId(id); this.headers[i]=hdr; } // 6. buf if(!Util.isFlagSet(leading, BUF_SET)) return -1; length=in.readInt(); return in.position(); }