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 readPostiveInt() throws IOException {
      final byte[] bytes = {'1', '0', '\r', '\n'};
      setupInputStreamRead(bytes, 1);
      int actualInt = reader.readInt();
      assertEquals(10, actualInt);
    }
test_case.class_method_signature: RedisStreamReaderTest.readPostiveInt()
test_case.full_signature: @Test public void readPostiveInt()
test_case.identifier: readPostiveInt
test_case.invocations: setupInputStreamRead readInt assertEquals
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void readPostiveInt()
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 int readInt() throws IOException {
      int length = 0;
      final byte[] allIntBytes = new byte[13]; // maximum integer length + minus symbol + CR + LF = 13
      while ((allIntBytes[length++] = readByte()) != RedisBytes.CARRIAGE_RETURN_BYTE) {
        ;
      }
      //Read Line feed byte
      readByte();
      int number = 0;
      final boolean negative = allIntBytes.length > 0 && allIntBytes[0] == RedisBytes.DASH_BYTE;
      //We don't read last value if it's negative
      for (int i = length - 2, j = 0; i > (negative ? 0 : -1); i--, j++) {
        number += (int) (Math.pow(10, j) * (allIntBytes[i] - RedisBytes.ZERO_BYTE));
      }
      number = number * (negative ? -1 : 1);
      return number;
    }
focal_method.class_method_signature: RedisStreamReader.readInt()
focal_method.full_signature: public int readInt()
focal_method.identifier: readInt
focal_method.invocations: readByte readByte pow
focal_method.modifiers: public
focal_method.parameters: ()
focal_method.return: int
focal_method.signature: int readInt()