Linked Questions

Popular Questions

Check string or JSON size in memory

Asked by At

I have a rest service where one can send string field in body like that:

    "field1": "b14",
    "fieldWithContent": "there may be something big, it is xml",
    "field3": 0

Don't ask me why this fieldWithContent has xml inside :) I must validate whether the fieldWithContent is bigger than 1MB. How could I do that in Java ?

The rest endpoint is exposed through Camel but this has propably some second importance.

Related Questions