code: public String[] readStringArray(final int items, final JBBPByteOrder byteOrder) throws IOException {
      int pos = 0;
      if (items < 0) {
        String[] buffer = new String[INITIAL_ARRAY_BUFFER_SIZE];
        // till end
        while (hasAvailableData()) {
          final String next = readString(byteOrder);
          if (buffer.length == pos) {
            final String[] newbuffer = new String[buffer.length << 1];
            System.arraycopy(buffer, 0, newbuffer, 0, buffer.length);
            buffer = newbuffer;
          }
          buffer[pos++] = next;
        }
        if (buffer.length == pos) {
          return buffer;
        }
        final String[] result = new String[pos];
        System.arraycopy(buffer, 0, result, 0, pos);
        return result;
      } else {
        // number
        final String[] buffer = new String[items];
        for (int i = 0; i < items; i++) {
          buffer[i] = readString(byteOrder);
        }
        return buffer;
      }
  
    }
docs: Read array of srings from stream.
  
  @param items     number of items, or -1 if read whole stream
  @param byteOrder order of bytes in structure, must not be null
  @return array, it can contain null among values, must not be null
  @throws IOException thrown for transport errors
  @see JBBPBitOutputStream#writeStringArray(String[], JBBPByteOrder)
  @since 1.4.0