code: private void receiveMessage(ClientSocket client, DataInputStream buffer, byte from, StateConnection expected)
              throws IOException
      {
          if (ServerImpl.checkValidity(client, from, expected))
          {
              final byte dest = buffer.readByte();
              final byte type = buffer.readByte();
              final int size = buffer.readInt();
              if (size > 0)
              {
                  final byte[] clientData = new byte[size];
                  if (buffer.read(clientData) != -1) // CHECKSTYLE IGNORE LINE: TrailingComment|NestedIfDepth
                  {
                      final DataInputStream clientBuffer = new DataInputStream(new ByteArrayInputStream(clientData));
                      decodeMessage(type, from, dest, clientBuffer);
                  }
              }
              final int headerSize = 4;
              bandwidth += headerSize + size;
          }
      }
docs: Update the receive standard message state.
  
  @param client The client to test.
  @param buffer The data buffer.
  @param from The id from.
  @param expected The expected client state.
  @throws IOException If error.