@Test
public void readUTF8AsciiStringWithLengthCap() throws IOException {

    // Ascii text: 1 byte per character, so no risk to truncate a character.
    String bigText = bigAsciiText();
    TestInputStream stream = TestInputStream.withUTF8String(bigText);
    assertThat(DockerCloudUtils.readUTF8String(stream, 5)).
            isEqualTo(bigText.substring(0, 5));
}