{
command = null;
}
if ( command != null )
{
SCDataBuilder builder = command.newBuilder();
for ( SCDataBuilderTypeAndCount tc : command.getTypesAndCounts() )
{
switch ( tc.type )
{
case FIXED_SIZE_VALUE_SET:
{
for ( int i = 0; i < tc.count; ++i )
{
builder.addNextValue(fClient.readLine());
}
break;
}
case BOUNDED_VALUE_SET:
{
int lineQty = sizeFromLine(fClient.readLine());
for ( int i = 0; i < lineQty; ++i )
{
builder.addNextValue(fClient.readLine());
}
break;
}
case OBJECT:
{
int size = sizeFromLine(fClient.readLine());
if ( size > 0 )
{
ChunkedByteArray bytes = fClient.readBytes(size);
builder.addNextObject(bytes);
}
break;
}
case UNBOUNDED_VALUE_SET:
{
for(;;)
{
String nextLine = fClient.readLine();
if ( nextLine.trim().length() == 0 )
{
break;
}
builder.addNextValue(nextLine);
}
break;
}
}
}
builder.executeCommand(fServer, this);
fClient.flush();
}
fCurrentCommand = null;
}