try {
while (read(mServer, temp, 0, MSG_LENGTH) == MSG_LENGTH) {
final int cmd = FileUtils.peekInt(temp, 0, ByteOrder.BIG_ENDIAN);
if (cmd == CMD_WRITE) {
int len = FileUtils.peekInt(temp, 4, ByteOrder.BIG_ENDIAN);
while (len > 0) {
int n = read(mServer, temp, 0, Math.min(temp.length, len));