test_class.declarator: SIZE = 8192
test_class.modifier: private static final
test_class.original_string: private static final int SIZE = 8192;
test_class.type: int
test_class.var_name: SIZE
test_class.declarator: reader
test_class.original_string: RedisStreamReader reader;
test_class.type: RedisStreamReader
test_class.var_name: reader
test_class.declarator: inputStream
test_class.modifier: @Mock
    private
test_class.original_string: @Mock
    private InputStream inputStream;
test_class.type: InputStream
test_class.var_name: inputStream
test_class.file: imcache-redis/src/test/java/com/cetsoft/imcache/redis/client/RedisStreamReaderTest.java
test_class.identifier: RedisStreamReaderTest
test_case.body: @Test
    public void readLongString() throws IOException {
      char theChar = '*';
      final byte[] bytes = new byte[10002];
      String expectedString = "";
      for (int i = 0; i < bytes.length - 2; i++) {
        bytes[i] = (byte) theChar;
        expectedString += theChar;
      }
      bytes[bytes.length - 2] = '\r';
      bytes[bytes.length - 1] = '\n';
      setupInputStreamRead(bytes, SIZE);
      String actualString = reader.readString();
      assertEquals(expectedString, actualString);
    }
test_case.class_method_signature: RedisStreamReaderTest.readLongString()
test_case.full_signature: @Test public void readLongString()
test_case.identifier: readLongString
test_case.invocations: setupInputStreamRead readString assertEquals
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void readLongString()
focal_class.declarator: BUFFER_SIZE = 8192
focal_class.modifier: public static final
focal_class.original_string: public static final int BUFFER_SIZE = 8192;
focal_class.type: int
focal_class.var_name: BUFFER_SIZE
focal_class.declarator: inputStream
focal_class.modifier: private final
focal_class.original_string: private final InputStream inputStream;
focal_class.type: InputStream
focal_class.var_name: inputStream
focal_class.file: imcache-redis/src/main/java/com/cetsoft/imcache/redis/client/RedisStreamReader.java
focal_class.identifier: RedisStreamReader
focal_class.interfaces: implements Closeable
focal_class.class_method_signature: RedisStreamReader.RedisStreamReader(InputStream inputStream)
focal_class.full_signature: public  RedisStreamReader(InputStream inputStream)
focal_class.identifier: RedisStreamReader
focal_class.modifiers: public
focal_class.parameters: (InputStream inputStream)
focal_class.signature:  RedisStreamReader(InputStream inputStream)
focal_class.class_method_signature: RedisStreamReader.readByte()
focal_class.full_signature: public byte readByte()
focal_class.identifier: readByte
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: byte
focal_class.signature: byte readByte()
focal_class.class_method_signature: RedisStreamReader.readString()
focal_class.full_signature: public String readString()
focal_class.identifier: readString
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String readString()
focal_class.class_method_signature: RedisStreamReader.readInt()
focal_class.full_signature: public int readInt()
focal_class.identifier: readInt
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int readInt()
focal_class.class_method_signature: RedisStreamReader.read(int length)
focal_class.full_signature: public byte[] read(int length)
focal_class.identifier: read
focal_class.modifiers: public
focal_class.parameters: (int length)
focal_class.return: byte[]
focal_class.signature: byte[] read(int length)
focal_class.class_method_signature: RedisStreamReader.close()
focal_class.full_signature: @Override public void close()
focal_class.identifier: close
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void close()
focal_method.body: public String readString() throws IOException {
      int noOfBytesRead, newLength;
      byte[] bytes = new byte[0];
      final byte[] tempBytes = new byte[BUFFER_SIZE];
      do {
        noOfBytesRead = inputStream.read(tempBytes);
        newLength = noOfBytesRead
            - (noOfBytesRead > 1 && tempBytes[noOfBytesRead - 2] == RedisBytes.CARRIAGE_RETURN_BYTE
            ? 2 : 0)
            - (noOfBytesRead > 0 && tempBytes[noOfBytesRead - 1] == RedisBytes.CARRIAGE_RETURN_BYTE
            ? 1 : 0);
        byte[] newBytes = new byte[newLength + bytes.length];
        System.arraycopy(bytes, 0, newBytes, 0, bytes.length);
        System.arraycopy(tempBytes, 0, newBytes, bytes.length, newLength);
        bytes = newBytes;
      } while (noOfBytesRead != -1 && newLength == noOfBytesRead);
      return new String(bytes);
    }
focal_method.class_method_signature: RedisStreamReader.readString()
focal_method.full_signature: public String readString()
focal_method.identifier: readString
focal_method.invocations: read arraycopy arraycopy
focal_method.modifiers: public
focal_method.parameters: ()
focal_method.return: String
focal_method.signature: String readString()