How to read all available characters to a `String` using `BufferedReader`? 

I have a `Socket` from which I want to read data, when available, and store it in a `String`. The thing is, I can't use `readLine` because the data I receive not always contains a newline or caret return, and `readLine` blocks thread until it can read a full line. How to use `read` instead?

```
thread = new Thread(() ->
    {
        try {
            out = new PrintWriter(client.getOutputStream(), true);
            in = new BufferedReader(new InputStreamReader(client.getInputStream()));

             while(true) 
             {
                if (in.ready())
                {
                    String someString = // ? read available data
                    delegate.didReadData(this, someString);
                }
             }

        } catch (IOException e) {
            delegate.didDropSocket(this);
        }
    });
    thread.start();

```

**edit**  

1. delegate doesn't care how long the string is, it just needs to handle any hada that arrives via socket - and full contents of it  

2. I don't need to cut data into chunks - I want to read everyhing that arrives  

3. Yes, I have an infinite loop for I need to stay connected to the socket and listen for data until client drops the connection - when I get an `IOException`. I use a separate thread for socket because there will be much more sockets to listen to.