public int read(DataInputStream istream) throws IOException { preRead(); int retVal = 0; // read header retVal += header.read(istream); // read length { length = (short) (istream.readUnsignedByte()); retVal += 1; } // read programIndex { programIndex = (short) (istream.readUnsignedByte()); retVal += 1; } // read txnId { txnId = (short) (istream.readUnsignedByte()); retVal += 1; } // read ltsid { ltsid = (short) (istream.readUnsignedByte()); retVal += 1; } // read programNumber { programNumber = istream.readUnsignedShort(); retVal += 2; } // read sourceId { sourceId = istream.readUnsignedShort(); retVal += 2; } // read caPmtCmdId { caPmtCmdId = (short) (istream.readUnsignedByte()); retVal += 1; } // read bf2 retVal += bf2.read(istream); // read StatusfieldCheckInstance if (getProgramInfoLength() != 0) { StatusfieldCheckInstance = new StatusfieldCheck(this); retVal += StatusfieldCheckInstance.read(istream); } // read CaEntries for (; istream.available() > 0; ) { CaPmtModeMsg temp; temp = new CaPmtModeMsg(); retVal += temp.read(istream); CaEntries.add(temp); } postRead(); return retVal; }
public int write(DataOutputStream ostream) throws IOException { preWrite(); int retVal = 0; { /** fix dependent sizes for header * */ } { /** fix dependent sizes for StatusfieldCheckInstance * */ } { /** fix dependent sizes for CaEntries* */ } // write header if (header != null) retVal += header.write(ostream); // write length ostream.writeByte(length); retVal += 1; // write programIndex ostream.writeByte(programIndex); retVal += 1; // write txnId ostream.writeByte(txnId); retVal += 1; // write ltsid ostream.writeByte(ltsid); retVal += 1; // write programNumber ostream.writeShort(programNumber); retVal += 2; // write sourceId ostream.writeShort(sourceId); retVal += 2; // write caPmtCmdId ostream.writeByte(caPmtCmdId); retVal += 1; // write bf2 ostream.writeShort(bf2.getValue()); retVal += 2; // write StatusfieldCheckInstance if (StatusfieldCheckInstance != null) retVal += StatusfieldCheckInstance.write(ostream); // write CaEntries { ArrayList<CaPmtModeMsg> temp1 = CaEntries; for (int iIdx = 0; iIdx < temp1.getCount(); iIdx++) { CaPmtModeMsg temp2 = temp1.get(iIdx); if (temp2 != null) retVal += temp2.write(ostream); } } postWrite(); return retVal; }
public int write(DataOutputStream ostream) throws IOException { preWrite(); int retVal = 0; { /** fix dependent sizes for programInfo * */ if (programInfo != null) setProgramInfoLength((short) programInfo.getSize()); } // write bf1 ostream.writeShort(bf1.getValue()); retVal += 2; // write programInfo if (programInfo != null) retVal += programInfo.write(ostream); postWrite(); return retVal; }
public int read(DataInputStream istream) throws IOException { preRead(); int retVal = 0; // read bf1 retVal += bf1.read(istream); // read programInfo { int iCount = getProgramInfoLength() + (0); byte[] ba = new byte[iCount]; istream.readFully(ba); ByteArrayInputStream baTemp = new ByteArrayInputStream(ba); retVal += programInfo.read(new DataInputStream(baTemp)); } postRead(); return retVal; }
public int readNoHeader(DataInputStream istream) throws IOException { preRead(); int retVal = 0; // read length { length = (short) (istream.readUnsignedByte()); retVal += 1; } // read caPmtlisMngement { caPmtlisMngement = (short) (istream.readUnsignedByte()); retVal += 1; } // read programNumber { programNumber = istream.readUnsignedShort(); retVal += 2; } // read bf1 retVal += bf1.read(istream); // read bf2 retVal += bf2.read(istream); // read StatusfieldCheckInstance if (getProgramInfoLength() != 0) { StatusfieldCheckInstance = new StatusfieldCheck(this); retVal += StatusfieldCheckInstance.read(istream); } // read CaEntries for (; istream.available() > 0; ) { CaPmtModeMsg temp; temp = new CaPmtModeMsg(); retVal += temp.read(istream); CaEntries.add(temp); } postRead(); return retVal; }
public void setProgramInfoLength(int val) { bf1.setValue((bf1.getValue() & 0xfffff000) | ((val << 0) & 0x00000fff)); }
public int getProgramInfoLength() { return (bf1.getValue() & 0x00000fff) >> 0; }
public void setReserved2(int val) { bf1.setValue((bf1.getValue() & 0xffff0fff) | ((val << 12) & 0x0000f000)); }
public int getReserved2() { return (bf1.getValue() & 0x0000f000) >> 12; }
public void setReserved(int val) { bf2.setValue((bf2.getValue() & 0xffff0f7f) | ((val << 7) & 0x0000f080)); }
public int getReserved() { return (bf2.getValue() & 0x0000f080) >> 7; }