Code example for DataOutputStream

Methods: writeBoolean, writeByte

0
    /** 
     * Abstract. Writes the raw packet data to the data stream. 
     */ 
    public void writePacketData(DataOutputStream par1DataOutputStream) throws IOException
    { 
        par1DataOutputStream.writeByte(this.windowId & 255);
        par1DataOutputStream.writeByte(this.inventoryType & 255);
        writeString(this.windowTitle, par1DataOutputStream);
        par1DataOutputStream.writeByte(this.slotsCount & 255);
        par1DataOutputStream.writeBoolean(this.field_94500_e);
    } 
 
    /** 
     * Abstract. Return the size of the packet (not counting the header). 
     */ 
    public int getPacketSize() 
    { 
        return 4 + this.windowTitle.length();
    } 
}