package uc; import java.io.*; public class MainFrameTextUCMsg extends UCMsg { private String[] text; public MainFrameTextUCMsg( String[] text ) { this.text = text; type = MAINFRAMETEXT; unpacked = true; } MainFrameTextUCMsg( byte[] data ) { this.data = data; type = MAINFRAMETEXT; } public String[] getText() { unpack(); return text; } public void setText( String[] text ) { data = null; this.text = text; } void read( DataInputStream dataIn ) throws IOException { int length = dataIn.readInt(); text = new String[ length ]; for( int i = 0; i < length; i++ ) text[ i ] = dataIn.readUTF(); } void write( DataOutputStream dataOut ) throws IOException { dataOut.writeInt( text.length ); for( int i = 0; i < text.length; i++ ) dataOut.writeUTF( text[ i ] ); } public void open( UCMessageable processor ) { processor.processMsg( this ); } }