# Region Disk space management: deletes a specified media file on the player.
Public Void Commandsetmanagedisk ( Byte GID, Byte Did, String Deletestring)
{
// Packet forwarding
String Managediskstr = Deletestring;
Byte I = 0 ;
Encoding gb2312encoding = Unicodeencoding. getencoding ( " Gb2312 " );
Byte [] Managedisk = Gb2312encoding. getbytes (managediskstr );
Byte [] Mymanagedisk = New Byte [ 300 ];
Int Txtlength = Managedisk. length;
Int Packetizationtimer = Txtlength / 300 ;
Int Packetizationresidue = Txtlength % 300 ;
Int Packetizationsender;
// If there is no remainder, you do not need to send more packets once.
If (Packetizationresidue > 0 )
{
Packetizationsender = Packetizationtimer + 1 ;
}
Else
{
Packetizationsender = Packetizationtimer;
}
// Start Subcontracting
For (I = 0 ; I < Packetizationsender; I ++ )
{
If (I < Packetizationtimer)
{
Array. Copy (managedisk, I * 300 , Mymanagedisk, 0 , 300 );
}
Else
{
Array. Copy (managedisk, I * 300 , Mymanagedisk, 0 , Packetizationresidue );
}
Playermessages. setmanagedisk = New Playermessages. setmanagedisk ();
Setmanagedisk. Direct = 0x02 ;
Setmanagedisk. Category = 0x03 ;
Setmanagedisk. Type = 0x10 ;
Setmanagedisk. groupid = GID;
Setmanagedisk. DeviceID = Did;
Setmanagedisk. Sequence = I;
Setmanagedisk. Size = 300 ;
If (I = (Packetizationsender - 1 )){
Setmanagedisk. Sequence = 0xff ;
Setmanagedisk. Size = ( Ushort ) Packetizationresidue;
}
Setmanagedisk. deletefile = Mymanagedisk;
Byte [] Data = Playermessages. structtobytes (setmanagedisk );
Ssock. onudpdatasend (data );
}
}
Playermessages. setmanagedisk is a struct, UDP Packet Data Structure
Setmanagedisk. Sequence = I; indicates the number of the package, and 0xff indicates the last package