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 dump(DumpContext dc) throws IOException { dc.indent(); dc.getPs().print("ProgramInfo\n"); dc.increaseIndent(); int retVal = 0; // write bf1 { dc.indent(); dc.getPs().print("reserved2: "); dc.getPs().println(BitField_8.toDisplayString(getReserved2(), 4)); dc.indent(); dc.getPs().print("programInfoLength: "); dc.getPs().println(BitField_8.toDisplayString(getProgramInfoLength(), 12)); } // write programInfo if (programInfo != null) { dc.indent(); dc.getPs().println("programInfo"); retVal += programInfo.dump(dc); } dc.decreaseIndent(); return retVal; }